This allows you to be notified of system events for your ECS instances in your DingTalk group, enabling you to handle exceptions promptly.
Background
ECS instances can generate various system events during their lifecycle, such as status changes and operational events. For more information, see Summary of ECS system events. Some system events indicate that an instance is not running correctly, and operations personnel must be notified of these events immediately. If your team uses a DingTalk group for daily communication, you can configure a DingTalk chatbot to automatically send event notifications to the group. This helps you respond to instance exceptions more quickly and efficiently.
This procedure uses a DingTalk chatbot and CloudMonitor.
-
Create a DingTalk chatbot for a DingTalk group.
-
Set the DingTalk chatbot's webhook URL as the notification method for an alert contact.
-
In a CloudMonitor subscription policy, use an alert contact group that contains the configured alert contact.
After the setup is complete, the automated notification flow is as follows:
-
When an Alibaba Cloud underlying service detects a system event on an ECS instance, such as a lifecycle status change or an operational event, it automatically pushes the event to the Event Center in CloudMonitor.
-
Based on your subscription policy, CloudMonitor sends a notification to the specified alert contact group. The group's notification methods include the DingTalk chatbot's webhook URL.
-
The DingTalk chatbot receives the event data and automatically sends a notification message to the DingTalk group.
Step 1: Create a DingTalk chatbot
Creating a DingTalk chatbot generates a unique webhook URL that you can use to receive notifications from other services, such as CloudMonitor.
For instructions on how to create a DingTalk chatbot, see Steps 1, 3, 4, 5, and 6 in Create a custom chatbot.
As of September 1, 2023, you can no longer create custom chatbots for non-enterprise DingTalk groups. Existing custom chatbots are not affected.
When you create the chatbot, you must add keywords. For example, because event notifications from CloudMonitor typically contain the word CloudMonitor, this example uses CloudMonitor as a keyword.
Step 2: Link chatbot to event subscription
This step highlights the operations for associating a DingTalk chatbot with a subscription policy. For more information, see Create an alert contact or an alert contact group and Manage event subscriptions (Recommended).
-
Log on to the Cloud Monitor console.
-
Create an alert contact.
-
In the left-side navigation pane, choose .
-
Click Create Alert Contact.
-
In the Set Alert Contact panel, configure the contact as prompted.
To associate the DingTalk chatbot, enter the webhook URL that you saved in Step 1: Create a DingTalk chatbot into the DingTalk | Lark | WeCom | Slack Webhook(http|https): field.
-
-
Create an alert contact group.
-
Click the Alert Contact Group tab.
-
Click Create Alert Contact Group.
-
In the Create Alert Contact Group panel, configure the group as prompted.
To associate the DingTalk chatbot, add the new alert contact to the alert contact group.
-
-
Create a subscription policy.
-
In the left-side navigation pane, choose .
-
Click the Subscription Policy tab.
-
Click Create Subscription Policy.
-
On the Create Subscription Policy page, configure the subscription settings as prompted.
Note the following settings:
-
This topic uses an ECS instance status change as an example.
NoteThe event level for instance status changes is Notification (Info). Events at this event level can be frequent, causing many notifications. In production, select only relevant events.

-
In the notification settings, you must include the alert contact group that is associated with your DingTalk chatbot, as shown in the following figure.

-
-
Example: DingTalk notifications
After completing the configuration, test the notification by changing an instance's status. For example, stopping an instance triggers an event notification in your DingTalk group, as shown in the following figure.