简体   繁体   中英

Azure Monitor / Log Analytics metric alert query

I have an Azure Monitor log analytics workspace. I have the MMA agent installed on an Exchange server on-premises and it's uploading event and perf data to Azure. I can chart the monitor I'm interested in, based on this query:

Perf
| where CounterName == "Free Megabytes" and InstanceName == "D:" 
| where TimeGenerated > ago(7d)
| where Computer == "EXCH13.xxx.local" 

I need to create an alert when available disk space goes below 20 GB but in trying to create a log based alert it's just alerting based on the number of times the query has run in a given time. And when I try to create a metrics based alert is says the query must include 'AggregatedValue' and 'bin(TimeGenerated, [roundTo])'. I just need it to look at the log data and let me know when it goes below 20 GB. Any ideas?

According to my test, we can use the following query to view the log when the free disk space goes below xxx GB. For example

Perf
| where CounterName == "Free Megabytes" and InstanceName == "D:"
| where TimeGenerated > ago(7d)
| where Computer == "jimtest"
| where CounterValue <= 30720 (free disk space goes below 30 GB)

It will return logs with less than 30gb of free disk space. 在此处输入图片说明

Regarding how to create alert condition, please refer to the following picture在此处输入图片说明 It means that we will receive the alert when the number of logs with less than 20gb of free disk space.

For more details, please refer to the document . 在此处输入图片说明


Update

According to my research, Azure monitor also provides the template of metrics Logical Disk Free Megabytes . For more details, please refer to the document . 1. Configure workspace to collect the metric 在此处输入图片说明 在此处输入图片说明

  1. configure condition在此处输入图片说明 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM