Configure alert rules for application groups by using alert templates

更新时间:
复制 MD 格式

If your Alibaba Cloud account has a large number of cloud resources, you can manage these cloud resources by using application groups. To configure an alert rule for multiple application groups, you can create an alert template.

Background information

This topic describes how to configure alert rules for Elastic Compute Service (ECS), ApsaraDB RDS, and Server Load Balancer (SLB) instances by using alert templates and application groups. Cloud Monitor monitors these instances based on the configured alert rules.

Procedure

  1. Create an alert contact.

    1. Log on to the Cloud Monitor console.

    2. In the left-side navigation pane, choose Alerts > Alert Contacts.

    3. On the Alert Contacts tab, click Create Alert Contact.

    4. In the Set Alert Contact panel, enter the name, mobile number, email, and webhook URL, and leave Alert Notification Language set to Auto.

      Note

      With the Automatic setting, Cloud Monitor adapts the language of alert notifications based on your Alibaba Cloud account's registration language.

    5. Optional. Test the connectivity of the webhook URL.

      If you want to test the connectivity of the webhook URL, perform the following steps:

      1. Click Test next to the webhook URL.

        In the Webhook Test panel, you can check the connectivity and use the returned status code and test result details to troubleshoot issues.

        Note

        You can also set the Test Template Type and Language for the webhook and click Test again to obtain the corresponding test result details.

      2. Click Close.

    6. Verify the information and click OK.

    7. (Optional) Activate the email address and mobile number of the alert contact.

      The status of a new email address and mobile number is Pending Activation. To receive alerts, the contact must click the activation link in the email and text message within 24 hours. Activated contact details will then appear in the alert contact list.

  2. Create an alert contact group. For example, you can create a group named InventoryManagementAlertGroup.

    1. On the Alert Contacts page, click the Alert Contact Group tab.

    2. On the Alert Contact Group tab, click Create Alert Contact Group.

    3. In the Create Alert Contact Group panel, enter a name for the group and select the desired alert contacts.

    4. Click OK.

  3. Create an application group. For example, you can create an application group named InventoryManagementOnlineEnvironment.

    1. In the left-side navigation pane, click Application Groups.

    2. On the Application Groups tab, click Create Application Group in the upper-left corner.

    3. In the Create Application Group panel, set Creation Method to Create Based on Instance Name, name the group Inventory Management Production Environment, and set Alert Contact Group to Inventory Management Alert Group. Then, configure dynamic matching rules based on the names of your ECS, ApsaraDB RDS, and SLB instances.

    4. Click OK.

  4. Create an alert template and apply it to an application group. For example, you can create an alert template named E-commerceBackgroundModuleTemplate.

    1. In the left-side navigation pane, choose Alerts > Alert Templates.

    2. On the Alert Templates page, click Create Alert Template.

    3. In the Create Alert Template panel, enter E-commerce Backend Module Template for Template Name, and then configure the alert rules for ECS, ApsaraDB RDS, and SLB.

    4. Click OK.

    5. In the Alert Template Created/Modified dialog box, click OK.

    6. In the Apply Templates to Groups dialog box, select the Inventory Management Production Environment application group. Then, configure the Mute For, Effective Period, Alert Callback, and Priority parameters.

    7. Click OK.

    8. In the Apply Templates to Groups dialog box, click OK.

  5. View the health status of each instance that matches the alert rules in the application group.

    1. In the left-side navigation pane, choose Cloud Resource Monitoring > Application Groups.

    2. On the Application Groups tab, click the name of the target application group.

    3. In the left-side navigation pane of the application group, click Group Resources.

      View the health status of each instance that matches the alert rules in the application group.

      If an instance has no active alerts, its Health Status is 正常. If an alert is active for an instance, its Health Status is 报警.