Azure VM alerting for process and services

258 Views Asked by At

All,

I have windows VMs where AMA agent is installed with DCR configuration. How do I report on specific alert on process and service ?

Another requirement is this possible to alert on affected VM with top 10 process output when alert is sent . This helps the person who is going to work on VM to know process status on machine which is consuming most memory or CPU ?

1

There are 1 best solutions below

11
Venkat V On

I have windows VMs where AMA agent is installed with DCR configuration. How do I report on specific alert on process and service ?

If you want to create an alert for a process, follow the steps below.

  1. Create a Log Analytics Work Space
  2. Create a Data Collection Rule, follow the MS Doc

3.Run the following Kusto Query Language query to check VM processes

KQL Query:

Perf
| where ObjectName == "Process" 
| where CounterName == "% Processor Time" 
| where CounterValue >= 80
| project InstanceName, CounterValue

Result:

enter image description here

For creating an alert for VM Service follow my SO thread, which is related to creating an alert on a specific service.

Another requirement is this possible to alert on affected VM with top10 process output when alert is sent . This helps the person who is going to work on VM to know process status on machine which is consuming most memory or CPU ?

Here is the Log Analytics query that retrieves the top 10 processes by CPU usage. However, it's not possible to send an alert with the top 10 results directly. Instead, you can use an Azure Logic App in conjunction with Azure Monitor alerts.

KQL Query:

Perf
| where ObjectName == "Process" and CounterName == "% Processor Time"
| summarize avg_CPU = avg(CounterValue) by InstanceName
| top 10 by avg_CPU desc

Output:

enter image description here