@Learner, Thanks for posting in Q&A.
Based on your issue description, you would like to monitor the free disk space of your device and receive an alert when is less than specific value.
In this case you need to have: One Log Analytics Workspace to collect performance counters from your devices. Connect the server to the Log Analytics Workspace. Configured the Log Analytics workspace to collect performance counters from your devices.
Please find below steps in detail:
Follow this document to create a log analytics workspace.
Then you need to go to your log analytics workspace and configure it to collect performance counters as per this document.
Note: If you only need to monitor the % free in the disk I would like to suggest you only enable "% Free space".
Once you have configured your Log Analytics workspace to collect performance counters, you only need to connect your devices to your Log Analytics Workspace. Under Virtual machines, select the workspace you would like to monitor and click on it.
You are going to see this screen in which you only need to click on "Connect" this step is going to install the OMS agent in your devices to collect the data from the devices into the Log Analytics Workspace. You can find more information about this agent in this documentation.
Now that you already have the devices connected to your Log Analytics Workspace and collecting performance counters. You only need to use below query to configure the alert.
Perf
| where ObjectName == "Logical Disk" and CounterName == "% Free Space"
| extend Free_Space_Percent = CounterValue
| summarize by Computer, InstanceName, Free_Space_Percent
//This section is meant to return logs that reflect when the % Free Space is less than a user-defined threshold
| where Free_Space_Percent < 20
//where is set the condition, you would like to monitor in this case when the value is less 20 it means its less than 20% free.
Go to the option "Logs" paste the query and run it, once you run the query you are going to see enable the button "+ New alert rule", to create the alert.
Create the alert following this documentation.
In the tab "Actions" there you can follow the document to create an action group to send emails, you can follow this documentation to create and configure the action group.
Hope it will help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.