[英]Alerts with Azure Monitor Agent Metrics
I am using the Azure Monitor Agent (AMA) to monitor a virtual machine.我正在使用 Azure Monitor Agent (AMA) 来监控虚拟机。 I need to make an alert if the free disk is less than 10%.如果可用磁盘少于 10%,我需要发出警报。 For this purpose i'm using the guest metric "disk/free_percent", with mean as type of data aggregation.为此,我使用访客指标“disk/free_percent”,将平均值作为数据聚合的类型。 On the graph, the values on the ordinate are the percentage of free disk?在图表上,纵坐标上的值是空闲磁盘的百分比? Because using df command on the virtual machine i have quite different values than the ones shown on the dashboard.因为在虚拟机上使用 df 命令,我得到的值与仪表板上显示的值完全不同。 I have to make an alert if free disk is below 10%.如果可用磁盘低于 10%,我必须发出警报。 What query i have to make using "disk/free_percent" to accomplish that task?我必须使用“disk/free_percent”进行什么查询才能完成该任务?
I've tryed to use operator "lesset than", unit as "number" and thrshold value as 10.我尝试使用运算符“小于”,单位为“数字”,thrshold 值为 10。
Disk Space will be computed in GB/MB units in general.磁盘空间通常以 GB/MB 为单位计算。
Instead of monitoring on a percentage basis, create an alert to check if the free disk space is less than 10gb.不是基于百分比进行监控,而是创建警报以检查可用磁盘空间是否小于 10gb。 As discussed here in Microsoft Q&A , I tried in my environment with a few modifications accordingly and I got the expected output for disk space.正如Microsoft Q&A中所讨论的那样,我在我的环境中进行了一些相应的修改,我得到了预期的 output 磁盘空间。
Query:询问:
let setgbvalue = 10;
Perf
| where ObjectName == "LogicalDisk" and CounterName == "Free Megabytes"
| where InstanceName !contains "C:"
| where InstanceName !contains "_Total"
| extend FreeSpaceGB = CounterValue/1024
| summarize FreeSpace = max(FreeSpaceGB) by InstanceName
| where FreeSpace < setgbvalue
Output: Output:
If requirement is only with percentage, then you can use computing operations like countervalue/1024 multiplied by 100.如果要求只是百分比,则可以使用 countervalue/1024 乘以 100 等计算操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.