If you plan on using OMS to monitor your Infrastructure, here is a quick guide on how to set OMS to send alerts you of low disk space.
Cameron Fuller has created an excellent performance solution for OMS in .omsview files which can be imported directly into the dashboard – the files and howto can be found here: OMS Server Performance.
As of writing this article OMS is being moved to the Azure portal – browse to Log Analytics > Select your worksapce > View Designer:
Import the files downloaded from the link above:
Note there’s two version I recommend using the ‘new query language’ file.
Save and Apply:
At this point OMS will start to collect data from the VM’s associated with the OMS workspace. This is a good time to setup ‘Action Groups’
Action Groups allow you to associate an action when an alert is triggered for example Email or send SMS to desired recipients.
Go to Monitoring > Action Groups > + Add Action Group
Once that has been created – its quite self explanatory on how to to set this up.
We will now configure an alert and associate this action group to it. Go back to OMS Workspace and select ‘Alerts’:
Select the target and add the alert criteria:
The below evaluation occurs every 1440 minutes (24 hours):
Copy and paste the low disk space query:
Perf | where ObjectName == "LogicalDisk" and CounterName == "% Free Space" | summarize FreeSpace = min(CounterValue) by Computer, InstanceName | where strlen(InstanceName) ==2 and InstanceName contains ":" | where FreeSpace < 10 | sort by FreeSpace asc
The above queries all monitored servers disk space and alerts when it is low 10%
That's it! you will now get an email like below when diskspace is running low: