To ensure the stability of your business running on Elastic Compute Service (ECS) instances and implement automated O&M, we recommend that you subscribe to event notifications to monitor system changes. This topic describes how to subscribe to ECS system events on the CloudMonitor console.
If your business requires fast response to events or may involve a large number of events, we recommend that you subscribe to ECS events through EventBridge. For more information, see Use EventBridge to quickly subscribe to ECS events.
Background information
CloudMonitor is a monitoring service that allows you to query, manage, and monitor the system events of Alibaba Cloud services in an integrated manner. For more information about CloudMonitor, see What is CloudMonitor?
You can use CloudMonitor to configure alert rules so that you are notified when system events occur. CloudMonitor supports the following notification methods:
Sends SMS, emails, or DingTalk messages.
Distributes the notifications to your Message Queue, Log Service, Function Compute, or Webhook services, so that you can handle the events in an automated manner.
Create a subscription policy
In this topic, a subscription policy is created for the Instance:StateChange system event.
Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
NoteYou can also perform the following steps to create a subscription policy by using the System Event menu:
In the left-side navigation pane, choose
.In the Welcome to the New Event Center section, click Create Immediately to create a subscription policy.
On the Subscription Policy tab, click Create Subscription Policy.
On the Create a subscription policy page, configure the parameters.
Basic information: Enter a name for the subscription policy.
Alert Subscription:
Subscription Type: Select System events.
Subscription Scope:
Products: Select Elastic Compute Service (ECS) from the drop-down list.
Event Type: Select Abnormal.
Event name: Select Instance:StateChange.
Event Level: Select Notification (Info).
Application grouping, Event Content, and Event Resources: Leave these parameters empty, which indicates that notifications will be sent for the Instance:StateChange events that occur on all ECS instances under all application groups of the account.
NoteFor a list of the system events supported by ECS, see System Event - Elastic Compute Service (ECS).
Combined noise reduction: Use the default settings.
Notification: Create a notification configuration. Use the default settings for Custom notification method.
When you create a notification configuration, enter a notification configuration name, set the Notification settings parameter to Set the notification group directly, select an alert contact group from the Contact Group drop-down list, and then click OK.
NoteFor more information about how to create a notification configuration, see the Create a notification configuration policy section of the "Manage notification configurations" topic.
CloudMonitor automatically sends alert notifications based on the notification methods for the alert contacts in the specified alert contact group. For example, if you specify a mobile number and an email address for an alert contact and use the default notification method as the custom notification method, the alert contact receives only alert phone calls, text messages, and emails.
Push and Integration: Leave this section empty.
NoteFor information about how to create a push channel, see Create a push channel.
For information about event notifications, see the following topics:
Debug event subscription
After you subscribe to system event notifications, you can use the debugging feature to check whether notifications can be sent to Message Queue, Log Service, Function Compute, and Webhook services as expected.
On the Subscription Policy tab, click Debug event subscription.
In the Create event debugging panel, set Products to Elastic Compute Service (ECS) and Name to Instance:StateChange.
CloudMonitor automatically generates the debugging content in the JSON format.
Click OK.
An Operation successful message appears. CloudMonitor automatically sends a test alert notification to the alert contacts based on the notification methods specified in the subscription policy.
References
You can specify follow-up actions for event notifications, so as to handle status change events of ECS instances in an automated manner. For example, you can specify a Message Service (MNS) queue in the policy. For more information about the operations, see Automate O&M based on status change events of ECS instances.