For the Alerts on VM down, you can use Azure Monitor Service and get these alerts configured.
Please check this document for more information:
https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-metric
I just tried this and you have more signal names to choose in this way:
One more way of configuring alerts for VM is by configuring health alerts in Azure portal.
For the disk space alert, please check these documents which can help you create as per your requirement:
https://learn.microsoft.com/en-us/archive/blogs/ukhybridcloud/azure-log-analytics-disk-space-usage
https://learn.microsoft.com/en-us/archive/blogs/ukhybridcloud/azure-log-analytics-disk-space-usage-part-2
Below is an example for reference:
//This query below will show you the Machines with less than 10 Gb. With free diskspace.
// you can change the value, currently in 10 Gb.
InsightsMetrics
| where Name == "FreeSpacePercentage"
| summarize arg_max(TimeGenerated, *) by Tags
// arg_max over TimeGenerated returns the latest record
| project TimeGenerated, Computer, Val, Tags
| where Val < 10
Steps to create the Log Search Alert
- Please go ahead into Log Analytics Workspace > Logs
- Run the query above and adjust it to your need.
- Click on run to test the result.
- New alert rule
Hope this information helps.
Please 'Accept as answer' if the provided information is helpful, so that it can help others in the community looking for help on similar topics.