How to setup an Azure Alert to be triggered when our VM disks go below 10% free space
Hi, we would like some assistance to setup an Azure alert with correct "Measurement" and "Alert logic" values. We are using this query that brings us the result of all our servers with their disks free space. We would like to setup an alert using this query that should triggered when any of the disks goes below 10% of Free space. We are not sure on the correct values to be used (Such as under Measurement; Measure, Aggregation type, Aggregation granularity and under Alert logic; Operator, Threshold Value, Frequency of evaluations etc):
InsightsMetrics
| where Name == 'FreeSpaceMB'
| summarize arg_max(TimeGenerated, *) by Tags, Computer
| extend Drive = tostring(parse_json(Tags)["vm.azm.ms/mountId"])
| extend Size = toreal(parse_json(Tags)["vm.azm.ms/diskSizeMB"])
| project
TimeGenerated,
Computer,
Drive,
bin(SizeGB = Size / 1024, 0.1),
bin(FreeGB = Val / 1024, 1)
| join kind=inner (InsightsMetrics
| where Name == "FreeSpacePercentage"
| summarize arg_max(TimeGenerated, *) by Tags, Computer
| extend Drive = tostring(parse_json(Tags)["vm.azm.ms/mountId"])
| project TimeGenerated, Computer, Drive, bin(FreePercent = Val, 1.1))
on Computer, Drive
| project TimeGenerated, Computer, Drive, SizeGB, FreeGB, FreePercent
| order by Computer asc
We are currently using these values but not getting the correct result s wondering what values do we need to select here while setting up this alert:
Many thanks