Can we Set Alert Rule With Variable in Description?

205 views Asked by At

In Azure Metric Alert rule. For example If i have 3 dimension with name "vm1", "vm2", "vm3" and condition is if cpu over 80% then trigger alert to pagerduty. If one of that have cpu over 80% then trigger to pagerduty with description or name is "Alert CPU Over 80% in {VMNAME in Dimension}. like this.

Have example or any way for config it.?

1

There are 1 answers

2
Venkat V On

Azure Metric Alert rule. For example If i have 3 dimension with name "vm1", "vm2", "vm3" and condition is if CPU over 80% then trigger alert to pagerduty.

Note: Azure Monitor Metric Alerts do not support dynamic variables in the alert description field to trigger alerts for individual Virtual Machine names.

You can create separate metric alert rules for each VM dimension with a static description.

Ex: Alert Rule for "vm1" with description "Alert CPU Over 80% in vm1"

I have created an alert rule for when the CPU load reaches 80% on a Virtual Machine.

enter image description here

Alert triggered when CPU load reached 80% in the portal as below.

enter image description here

Alert received to registered email as below.

enter image description here

You can similarly create multiple alerts for other virtual machines and apply an existing Action Group.