Dec 28 2022 06:44 PM
Can you monitor OSDisk freespace instead of OSDisk IOPs of Azure VM running windows?
I have a VM with only OS Disk attached and want to monitor its freespace and send email alerts.
I am not having any luck running this query for OS Disk.
let setgbvalue = 10;
Perf
| where ObjectName == "LogicalDisk"
| where InstanceName !contains "C:"
| where InstanceName !contains "_Total"
| extend FreeSpace = CounterValue/1024
| summarize FreeSpace = min(FreeSpace) by Computer, InstanceName
| where FreeSpace < setgbvalue
Jan 04 2023 02:51 AM
Mar 05 2023 11:29 AM - edited Mar 05 2023 11:31 AM
Greetings @cloudworxs and @tommykneetz
As per my understanding the Perf table is related to Log Analytics using MMA (Microsoft Monitoring Agent) and InsightMetrics is the table used by AMA (Azure Monitoring Agent).
I don't know if it is by design but I assume it is because by the moment I removed MMA and my queries stopped working the only way to have everything back using AMA was to use InsightMetrics table. I didn't find anywhere the accuracy of my assumption so I took it for granted.
That said, here it is something you can try to achieve your results:
InsightsMetrics
| where Namespace == "LogicalDisk" and Name == "FreeSpaceMB"
InsightsMetrics
| where Namespace == "LogicalDisk" and Name == "FreeSpacePercentage"
Cheers...