Help Center/ Cloud Application Engine/ Best Practices/ Sending Event Alarms to WeCom
Updated on 2024-05-25 GMT+08:00

Sending Event Alarms to WeCom

Overview

CAE can send notifications when instance scheduling, health check, image pull, volume mounting, or container startup succeeds or fails. By configuring event notification rules, you can learn about the component running status in a timely manner and quickly locate faults. The configuration of event notification rules depends on the AOM and SMN services. Component instance events are reported to AOM. You can choose Application O&M Management > Alarm Management > Alarm List > Events to view the reported events. SMN is the sender of alarm messages.

By default, CAE reports component instance events to AOM. After configuring event notification rules, CAE creates topics and subscribers in SMN, and creates alarm rules and alarm action rules in AOM.

Figure 1 Event alarm reporting process

Prerequisites

SMN allows you to subscribe to WeCom, DingTalk, and Lark group messages. Currently, these functions are in the open beta test (OBT). You need to apply for the OBT qualification first.

  • You have enabled WeCom and created a group chatbot.
  • You have submitted a service ticket to apply for the SMN OBT qualification on Huawei Cloud and enabled the OBT.

Procedure

  1. Log in to CAE and choose System Settings.
  2. Click Edit in the Event Notification Rules module.
  3. Click Create Event Notification Rule and configure basic information by referring to Table 1.

    Table 1 Configuring basic information

    Parameter

    Description

    Name

    Enter an event notification rule name. For example, container-Initiate.

    The value starts and ends with a letter and contains 1 to 64 characters, including letters, digits, hyphens (-), and underscores (_).

    Trigger Event

    Select an event that triggers notification from the drop-down list. For example, Container started up.

    Effected Components

    Select All in the environment.

    Alarm Policy

    Trigger Mode: Select Immediate.

  4. Select WeCom chatbot for Notified By.

    Enter the WeCom chatbot endpoint address, which is a webhook address starting with https://qyapi.weixin.qq.com/cgi-bin/webhook/send.

    For details about how to obtain a WeCom subscription endpoint, see How Does DingTalk, Lark, or WeCom Chatbot Obtain Subscription Endpoints?

    Figure 2 Configuring event notification

  5. Click OK.
  6. In the component list, select the target component and click More > Restart in the Operation column.

    After the component is restarted, log in to AOM to view the event list or receive alarms in your WeCom group.
    • Log in to AOM to view the list of events reported by CAE.
      1. Choose Alarm Management > Alarm List > Events.
      2. Select Select all for Event Severity.
      3. Set the filter criterion to Event Source: CAE and click .
    • Receive alarms in your WeCom groups.