CloudMonitor can send alerts by using emails or DingTalk chatbots. CloudMonitor can also send alerts by using the alert callback feature. You can handle alerts in a flexible manner. This topic describes how to use the alert callback feature to send the notifications for system event-triggered alerts to your O&M system or notification system.

Prerequisites

The public URL of your O&M system or notification system is available. The URL can be used to access your O&M system or notification system.

Background information

CloudMonitor sends alert notifications to the specified URL by using the HTTP POST method. You must add the following classless inter-domain routing (CIDR) blocks to the whitelist of your firewall:47.74.206.0/26, 47.74.206.64/26, 47.74.206.128/26, and 47.74.206.192/26. After you receive alert notifications, you can resolve issues based on the content of the alert notifications.

If an alert callback fails, CloudMonitor retries up to three times. The timeout period of each callback request is 5 seconds.

Procedure

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, choose Event Monitoring > System Event.
  3. Click the Event Alert tab.
  4. Find the alert rule that you want to modify and click Modify in the Actions column.
    Note You can also create alert rules for system events. For more information, see Create a system event-triggered alert rule.
  5. In the Create / Modify Event Alert panel, select URL Callback.
  6. Set Request Method to POST and enter the callback URL.
  7. Click OK.

Result

If the alert rule is triggered, CloudMonitor sends an alert notification to the callback URL by using the HTTP POST method. The following table describes the parameters that are configured in the HTTP POST request.
Parameter Data type Description
traceId String The ID of the event that the cloud service reports to CloudMonitor for troubleshooting.
resourceId String The ID of the resource.
ver String The version of the event.
product String The name of the cloud service. For more information about the cloud services that support system event-triggered alerts, see Appendix 2: System events.
instanceName String The instance name of the specified cloud service.
level String The severity level of the event. Valid values:
  • Critical
  • Warning
  • Info
userId String The ID of your Alibaba Cloud account.
content String The content of the event.
regionId String The ID of the region.
eventTime String The timestamp that indicates the time when the event occurs, in the date format. Specify the time in the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time must be in UTC.
name String The name of the event. For more information about the names of the events that are supported by each Alibaba Cloud service, see Appendix 2: System events.
id String The ID of the event.
status String The status of the event. For more information about the event status of each cloud service, see Appendix 2: System events.
Sample POST request
{
  "traceId": "b0eaeed6-6758-4d45-ac64-c52437de****",
  "resourceId": "acs:ecs:cn-hangzhou:145394352104****:snapshot/s-bp13s5zbbwxm780t****",
  "ver": "1.0",
  "product": "ECS",
  "instanceName": "s-bp13s5zbbwxm780t****",
  "level": "INFO",
  "userId": "145394352104****",
  "content": {
    "result": "accomplished",
    "snapshotId": "s-bp13s5zbbwxm780t****",
    "snapshotType": "timer",
    "snapshotName": "auto2.0_20210224_sp-bp1etszs074zjp4p****",
    "diskId": "d-bp1ioh7hw6l94rys****",
    "startTime": "2021-02-23T17:05:13Z",
    "endTime": "2021-02-23T17:11:13Z"
  },
  "regionId": "cn-hangzhou",
  "eventTime": "20210224T011113.709+0800",
  "name": "Snapshot:CreateSnapshotCompleted",
  "id": "103E55FC-7FC3-4B3D-AE12-C19EA84C****",
  "status": "Normal"
}