How can I set up alerts based on metrics collected by diagnostic agents?

Marcin Rostkowski 0 Reputation points
2024-05-11T18:43:41.0833333+00:00

I have installed diagnostic agents on virtual machines to generate metrics that I need to create alerts and dashboards. However, I cannot use these metrics when creating an alert or a dashboard for multiple machines. Even though diagnostic agents are installed on all machines, I can only choose standard metrics when selecting more than one virtual machine. The only way that I can choose all metrics is to select only one machine. Is there a way to set up alerts based on the metrics collected by diagnostic agents for multiple machines without manually creating a separate alert for each virtual machine based on each metric?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,259 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 4,190 Reputation points
    2024-05-11T20:58:51.0066667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    To set up alerts and dashboards based on metrics collected by diagnostic agents for multiple virtual machines, you can leverage Azure Monitor. Here's a guide on how to get started:

    1. In the Azure portal, navigate to the Alerts service under Monitor
    2. Create a new alert rule by selecting the appropriate scope (multiple virtual machines)
    3. In the Condition section, select the Custom log search signal type .
    4. Use the Kusto query language to query the metrics collected by the diagnostic agents across multiple virtual machines
         Perf 
            | where ObjectName == "Processor" and CounterName == "% Processor Time" 
            | summarize avg(CounterValue) by Computer, bin(TimeGenerated, 1m)
      
    5. Configure the alert logic based on the queried metrics
    6. Specify the action group to be triggered when the alert condition is met
    7. Review and create the alert rule

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    1 person found this answer helpful.
    0 comments No comments