Use event subscription

Last Updated: Oct 10, 2017

With Event Subscription, CloudMonitor pushes alarms to the specified Message Service queue, so you can connect to your service system by using alarm messages in the queue.

Note: The frequency of pushing an alarm message to Message Service is restricted by channel silence. If no status change occurs in 24 hours since an alarm is triggered, no more notifications are sent for another alarm triggered based on the same alarm rule.

Procedure

  1. Activate Message Service.

    • View the Message Service product introduction. See activation link here.

    • For the Message Service FAQs, click here.

  2. Go to the Event Subscription page on the CloudMonitor console to authorize CloudMonitor.

    If you use the event subscription function for the first time, you are required to authorize CloudMonitor the write permission to Message Service message queue.

  3. Create an event subscription.

    1. Click Create Event in the upper-right corner to create an event to receive alarm notifications.

    2. To finish an event subscription, select the queue information to receive alarm notifications and the type of the alarm notifications to be received.

  4. Use alarm notification service.

    You can use alarm notification service through Message Service APIs, and view the delivery status through the Message Service console.

Alarm notification format

Alarm messages received in Message Service are formatted as follows:

ECS alarm content

  1. {
  2. "message":{
  3. "expression": "Average value > 80%", // Alert policy description
  4. "curValue":"85.65",
  5. "unit": "%", //Unit
  6. "levelDescription": "alert triggered", //Alert status, including "alert triggered" and "alert cleared".
  7. "time": 1464257700000, // Time when an alert is triggered
  8. "metricProject": "acs_ecs", //Product name
  9. "userId":"1078500464551219",
  10. "dimensions": "ECS name=yapot_server_1, ECS instance ID=AY14051913564762762e, IP=182.92.79.214, mountpoint=/mnt", //Monitoring dimensions
  11. "evaluationCount": "1", //Number of retries
  12. "period": "Five minutes", //Statistical period
  13. "metricName": "Disk usage", // Metric name
  14. "alertName":"AY14051913564762762e_98591490-9eb4-42a1-ba2a-3bdbe04196df"
  15. },
  16. "type":0
  17. }

Server Load Balancer alert content

  1. {
  2. "message":{
  3. "expression": "maximum value > 2.0 Kb/s", // Alert policy description
  4. "curValue":"5",
  5. "unit": "Kb/s", //Unit
  6. "levelDescription": "alert triggered", //Alert status, including "alert triggered" and "alert cleared".
  7. "time": 1451767500000, // Time when an alert is triggered
  8. "metricProject": "acs_slb", //Product name
  9. "userId":"UserName", //
  10. "dimensions": "instanceId=InstanceId, port=3306, vip=10.157.161.2", //Monitoring dimensions
  11. "evaluationCount": "3", //Number of retries
  12. "period": "15 minutes", //Statistical period
  13. "metricName": "incoming data volume per second", // Metric name
  14. "alertName":"14a850c9d49-cn-beijing-btc-a01_3306_3da5a7df-0821-4cce-93bf-dafe8ce56a68"
  15. },
  16. "type": 0 // A reserved field. 0 indicates a status alert, including "triggered" and "cleared"; 1 indicates an exception notification, with an alert triggered at the occurrence of the exception and no status is logged.
  17. }
Thank you! We've received your feedback.