CloudMonitor allows you to receive alerts by using emails and DingTalk chatbots, and the alert callback feature. This topic describes how to use the alert callback feature to send alert notifications to your existing operations and maintenance (O&M) or notification system.

Prerequisites

The public URL of your O&M or notification system is available. Use the URL of your O&M or notification system as the callback URL.

Background information

CloudMonitor pushes alert notifications to the specified URL by sending HTTP POST requests. 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 fix issues based on the notification content.

If an alert callback fails, three retries are performed. Each callback request times out after 5 seconds.

Procedure

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, click Event Monitoring.
  3. On the Event Monitoring page, click the Alert Rules tab.
  4. On the System Event tab, click Modify in the Actions column of the required alert rule.
    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 pane, 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 a notification to the URL. The following table describes the parameters in the POST request.
Parameter 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 Overview.
instanceName String The name of the instance.
level String The severity 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 region ID.
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 Overview.
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 Overview.
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"
}