Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,798 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I have a custom query to tell me when a vm has a certain percentage of disk space. It is set to 90 right now for testing. Is there a way to Return a value of Health if nothing is found and Not-Healthy if this threshold is meant. I am new tot his and trying to figure this out so any help would be appreciated.
Something like this??
let HealthyPercent = 90;
InsightsMetrics
| where Origin == "vm.azm.ms"
and Namespace == "LogicalDisk" and Name == "FreeSpacePercentage"
| extend Disk=tostring(todynamic(Tags)["vm.azm.ms/mountId"])
| where Disk != "D:"
| summarize Disk_Free_Space = avg(Val) by Computer, Disk, _ResourceId
| project Computer, Disk, Disk_Free_Space, Status = iif(Disk_Free_Space < HealthyPercent, "Unhealthy", "Healthy")