Creating an alert and an action group

To create an alert, perform the following steps:

  1. From the Azure Monitor overview blade, in the left-hand menu, select Alerts. You can also go to the alerts settings by clicking on Create alert to create an alert directly.
  2. In the Alerts blade, click on + New alert rule in the top menu:

Creating a new alert
  1. The Create rule blade is displayed. Here, you can create the rule and action groups. To create a new rule, you need to first select the resource. Click on the Select button under the RESOURCE section:

Creating a new rule
  1. In the next blade, you can filter by the subscription and resource type. Select Virtual machines:

Filtering by subscription and resource type
  1. Select the VM from the list and click Done.
  2. Now that we have a resource selected, we're going to set up the condition. Click on Add condition.
  3. The condition blade is open, and so we can filter by a certain signal. Select Percentage CPU and click Done:

Filtering on a signal
  1. Next, you can set the alert logic for this alert. You can choose multiple operators, set the aggregation type, and set the threshold value for this alert. Set the following:
    • Threshold: Static (in the next section, we are going to cover the difference between static and dynamic thresholds)
    • Operator: Greater than
    • Aggregation type: Average
    • Threshold Value: 90%
  2. Leave Evaluated based on with its default settings.
  1. This alert will notify you when the CPU of the virtual machines is greater than 90% over a 5-minute period. Azure Monitor will check this every minute:

Setting condition values
  1. Click on Done to create this condition.
  2. Now, we have to create an action group to send the alert to. This is then responsible for handling the alert and taking further action on it. The action group that you create here can be reused across other alerts as well. So, in our case, we will create an email action group that will send out an email to a certain email address. After its creation, you can add this existing action group to other alerts. Under Action group, select the Create new button.
  1. In the Action Group blade, add the following settings:
    • Action group name: Type Send email.
    • Short name: Type email.
    • Subscription: Select the subscription where the VM is created.
    • Resource group: Select Default-ActivityLogAlerts (to be created).
  2. Then, we have to provide the actual action. Add the following values:
    • Action name: email
    • Action type: Email/SMS/Push/Voice
  1. Then, select Edit details and select the Email checkbox. Provide an email address and click on the OK button:

Creating an action group
  1. Click on OK again.
  1. Finally, you have to specify an alert name, set the severity level of the alert, and click on Create alert rule:

Alert settings

We have now created an alert and an action group that will alert a user via email when the CPU goes over 90%. In the next section, we're going to create a baseline for resources.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset