Alarm callback

BCM

  • Function Release Records
  • Product Announcement
    • Site Monitor Billing Announcement
  • Product Description
    • Product Introduction
    • Core concepts
    • Product advantages
    • Product features
  • Product pricing
    • Product pricing
    • Site Monitor Pricing
  • Quick Start
  • Operation guide
    • Enter Cloud Monitor
    • Dashboard
      • Overview
      • Management Dashboard Charts
      • Management Dashboard
    • Alarm Service
      • Overview
      • Alarm strategy
      • Alarm history
      • Alarm Template
      • Alarm Notification Template
      • Alarm callback
    • Cloud product monitor
      • Instance monitor
      • Instance Group
      • View Metrics
    • Site Monitor
      • Timed Detection (Formerly Site Monitor)
        • Overview
        • Manage Timed Probe Tasks
        • Purchase Guide
        • View timed probe tasks
      • IP advanced fault diagnosis
        • Manage IP Advanced Fault Diagnosis Tasks
        • View IP Advanced Fault Diagnosis Tasks
      • Instant probe
        • Overview
        • Manage instant probe tasks
    • Event Monitor
    • Event Bus
      • Event Delivery History
      • Overview
      • Event summary
      • Event Set
      • Event Rules
        • Event Rules
        • Event content conversion
        • Event pattern
  • API Reference
    • Overview
    • Service domain
    • Error response
    • Query Monitoring Data for Partial Dimensions
    • Dashboard API
    • Common Request and Response Headers
    • Alarm Management API
    • Alarm Management Interface V2
    • Alarm history
    • Push Data API
    • Event Bus Push
    • Application Monitor
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Instance Group Interface
    • Site Monitor
    • Query Latest Metric Data for Partial Dimensions
    • General Description
    • Query Data API
    • Event Monitor
    • Instant Probe
    • Event Alarm History
    • Notification Template
  • Java-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Batch Query Data Interface
    • Alarm History-related APIs
  • Python-SDK
    • Overview
    • Initialization
    • Install SDK
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy List API
    • Batch Data Query Interface
  • Go-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Alarm History-related APIs
    • Batch Data Query Interface
  • BCM-Agent
    • Functions
    • Monitoring Trend Chart
    • BCM-Agent-Frequently Asked Questions
    • Appendix
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
    • Performance-related questions
  • Cloud Product Monitor List
    • Cloud Product Metric List (Legacy Version Hidden)
    • Cloud Product Monitor Object Type List
    • Cloud Product Event List
    • Cloud Product Metric List
      • Database
        • Cloud Database TableStorage
        • Cloud Database DocDB for MongoDB
        • Data transmission service (DTS)
        • Cloud native database GaiaDB
        • Vector Database (VectorDB)
        • Dedicated Database Cluster (DDC)
        • Cloud Database Redis
        • Cloud database RDS
        • Cloud Database HBase
      • Enterprise Application
        • Message Service for RabbitMQ
      • Network
        • Service Network Interface Card (SNIC)
        • Peering Connections
        • IPv6 gateway
        • NAT Gateway
        • Load Balancer Dedicated Cluster LBDC
        • Baidu Load Balance (BLB)
        • Network probe NP
        • Dedicated channel
        • Elastic IP EIP
        • Elastic Network Interface Card (ENIC)
        • Cloud Smart Network (CSN)
        • Dedicated gateway
        • Virtual Private Network (VPN) Gateway
        • Layer 2 Gateway LTGW
        • Physical dedicated line
      • Intelligent Big Data
        • MapReduce BMR
        • Message service for Kafka-dedicated
        • Message Service for RocketMQ
        • Baidu Stream Computing (BSC)
        • Baidu Elasticsearch
        • Log Service BLS
        • Data warehouse DORIS
      • Cloud native
        • Cloud Function Computing
        • Baidu container instance (BCI)
      • Compute
        • Baidu Cloud Compute (BCC)
        • Elastic Baremetal Compute BBC
      • Storage and CDN
        • Parallel Filesystem Service (PFS)
        • Cloud File System (CFS)
        • Content delivery network (CDN)
        • Baidu object storage (BOS)
        • Cloud Disk Server (CDS)
        • Baidu edge computing (BEC)
      • Website service
        • Baidu Cloud Virtual Host (BCH)
      • Large Model Platform
        • Qianfan Large Model Platform ModelBuilder
  • Typical Practices
    • Scenarios for Batch Creation of Alarm Strategies
    • Usage Scenarios for Different Notification Channels
  • Service Level Agreement (SLA)
    • Site Monitor Service Level Agreement SLA
  • BCM-Tool
    • Uninstallation Method
    • Installation method
    • BCM-Tool-Frequently Asked Questions
    • Functions
    • Multi-Region Service
    • Application method
All documents
menu
No results found, please re-enter

BCM

  • Function Release Records
  • Product Announcement
    • Site Monitor Billing Announcement
  • Product Description
    • Product Introduction
    • Core concepts
    • Product advantages
    • Product features
  • Product pricing
    • Product pricing
    • Site Monitor Pricing
  • Quick Start
  • Operation guide
    • Enter Cloud Monitor
    • Dashboard
      • Overview
      • Management Dashboard Charts
      • Management Dashboard
    • Alarm Service
      • Overview
      • Alarm strategy
      • Alarm history
      • Alarm Template
      • Alarm Notification Template
      • Alarm callback
    • Cloud product monitor
      • Instance monitor
      • Instance Group
      • View Metrics
    • Site Monitor
      • Timed Detection (Formerly Site Monitor)
        • Overview
        • Manage Timed Probe Tasks
        • Purchase Guide
        • View timed probe tasks
      • IP advanced fault diagnosis
        • Manage IP Advanced Fault Diagnosis Tasks
        • View IP Advanced Fault Diagnosis Tasks
      • Instant probe
        • Overview
        • Manage instant probe tasks
    • Event Monitor
    • Event Bus
      • Event Delivery History
      • Overview
      • Event summary
      • Event Set
      • Event Rules
        • Event Rules
        • Event content conversion
        • Event pattern
  • API Reference
    • Overview
    • Service domain
    • Error response
    • Query Monitoring Data for Partial Dimensions
    • Dashboard API
    • Common Request and Response Headers
    • Alarm Management API
    • Alarm Management Interface V2
    • Alarm history
    • Push Data API
    • Event Bus Push
    • Application Monitor
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Instance Group Interface
    • Site Monitor
    • Query Latest Metric Data for Partial Dimensions
    • General Description
    • Query Data API
    • Event Monitor
    • Instant Probe
    • Event Alarm History
    • Notification Template
  • Java-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Batch Query Data Interface
    • Alarm History-related APIs
  • Python-SDK
    • Overview
    • Initialization
    • Install SDK
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy List API
    • Batch Data Query Interface
  • Go-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Alarm History-related APIs
    • Batch Data Query Interface
  • BCM-Agent
    • Functions
    • Monitoring Trend Chart
    • BCM-Agent-Frequently Asked Questions
    • Appendix
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
    • Performance-related questions
  • Cloud Product Monitor List
    • Cloud Product Metric List (Legacy Version Hidden)
    • Cloud Product Monitor Object Type List
    • Cloud Product Event List
    • Cloud Product Metric List
      • Database
        • Cloud Database TableStorage
        • Cloud Database DocDB for MongoDB
        • Data transmission service (DTS)
        • Cloud native database GaiaDB
        • Vector Database (VectorDB)
        • Dedicated Database Cluster (DDC)
        • Cloud Database Redis
        • Cloud database RDS
        • Cloud Database HBase
      • Enterprise Application
        • Message Service for RabbitMQ
      • Network
        • Service Network Interface Card (SNIC)
        • Peering Connections
        • IPv6 gateway
        • NAT Gateway
        • Load Balancer Dedicated Cluster LBDC
        • Baidu Load Balance (BLB)
        • Network probe NP
        • Dedicated channel
        • Elastic IP EIP
        • Elastic Network Interface Card (ENIC)
        • Cloud Smart Network (CSN)
        • Dedicated gateway
        • Virtual Private Network (VPN) Gateway
        • Layer 2 Gateway LTGW
        • Physical dedicated line
      • Intelligent Big Data
        • MapReduce BMR
        • Message service for Kafka-dedicated
        • Message Service for RocketMQ
        • Baidu Stream Computing (BSC)
        • Baidu Elasticsearch
        • Log Service BLS
        • Data warehouse DORIS
      • Cloud native
        • Cloud Function Computing
        • Baidu container instance (BCI)
      • Compute
        • Baidu Cloud Compute (BCC)
        • Elastic Baremetal Compute BBC
      • Storage and CDN
        • Parallel Filesystem Service (PFS)
        • Cloud File System (CFS)
        • Content delivery network (CDN)
        • Baidu object storage (BOS)
        • Cloud Disk Server (CDS)
        • Baidu edge computing (BEC)
      • Website service
        • Baidu Cloud Virtual Host (BCH)
      • Large Model Platform
        • Qianfan Large Model Platform ModelBuilder
  • Typical Practices
    • Scenarios for Batch Creation of Alarm Strategies
    • Usage Scenarios for Different Notification Channels
  • Service Level Agreement (SLA)
    • Site Monitor Service Level Agreement SLA
  • BCM-Tool
    • Uninstallation Method
    • Installation method
    • BCM-Tool-Frequently Asked Questions
    • Functions
    • Multi-Region Service
    • Application method
  • Document center
  • arrow
  • BCM
  • arrow
  • Operation guide
  • arrow
  • Alarm Service
  • arrow
  • Alarm callback
Table of contents on this page
  • Function overview
  • Instructions for use of alarm callback
  • Operation steps
  • Instructions for use of webhook
  • POST method parameter description
  • Metric alarm POST method parameter description
  • Event alarm POST method parameter description
  • URL callback example

Alarm callback

Updated at:2025-11-03

Function overview

Alarm callbacks enable BCM alarm notifications to be sent to a specified URL. You can process various alarm messages freely and flexibly. BCM supports pushing messages to a publicly accessible URL via POST requests using the HTTP/HTTPS protocol, allowing further processing of alarm information pushed through the callback API. To receive alarm notifications through office tools like WeCom, DingTalk, Infoflow, Zhiyinlou, Feishu, or Knock, please refer to the webhook usage instructions.

Instructions for use of alarm callback

  • Alarm callback API: You need to provide a publicly accessible URL address capable of receiving POST requests through the HTTP/HTTPS protocol as the callback address.
  • Alarm callback triggering: If an alarm callback address is provided, the triggering logic is the same as for alarms sent via SMS, email, and phone calls. When an alarm strategy is triggered or resolved, alarm messages will be sent via the callback API.
  • Binding the alarm callback API: You can add a callback API when creating an alarm strategy. Each alarm strategy can only be bound to one alarm callback URL.
  • Response content: After sending alarm information to the bound URL, we need to receive a response content (httpCode = 200) indicating successful receipt; otherwise, we will resend the alarm information three times at most, with a timeout duration of 5 s (retry mechanism)

Operation steps

Below is example of cloud product monitor, there are three entries for alarm callback function:

  • Entry I: Entry for uniformly creating alarm strategy
  1. In the left navigation bar, click Alarm Management, then Alarm Strategy, and under the cloud product monitor strategy list, click Add Strategy.

image.png

  1. On the Create Strategy page, activate the alarm callback and input a publicly accessible URL.

image.png

  • Entry II: Entry for creating an alarm strategy for a single instance under a cloud service
  1. Go to Cloud Product Monitor, then click on Instance Monitor in the left-hand menu to open the Instance List page. To access Baidu Cloud Compute (BCC) monitoring data, click on Baidu Cloud Compute Monitor to navigate to the Baidu Cloud Compute List page. From there, choose and click the relevant instance to proceed to the Alarm Strategy page.

image.png

  1. In the instance Alarm Strategy page, click Add Strategy

image.png

  1. On the Create Strategy page, activate the alarm callback and input a publicly accessible URL.

image.png

  • Entry III: Entry for creating an alarm notification template
  1. In the left-hand menu, select Alarm Management and then Alarm Template. Click on Add Template under the Alarm Action List page.

image.png

  1. In the Add Notification Template page, input a publicly accessible URL into the API callback field.

image.png

Notes Alarm notification templates support adding multiple callback addresses (5 at most).

Instructions for use of webhook

  • WeCom
  1. Log in to WeCom, open the designated WeCom group that will receive alarm notifications.
  2. After adding a group bot, copy the webhook address and paste it into Alarm Callback as instructed in the steps above.
  3. Once successfully configured, any triggered alarm notification will be sent to the WeCom group.
  • DingTalk
  1. Log in to DingTalk, open the DingTalk group designated to receive alarm notifications, and add a group bot.
  2. Complete the form, select the Custom Keywords option in the Security Settings section, and it is recommended to set Alarm as the keyword.

Note: Check the custom keywords box, enter up to 10 keywords, and ensure each message contains at least one keyword for successful delivery. For instance, if Alarm is set as a custom keyword, messages sent by the bot must include the word Alarm to guarantee successful delivery.

  1. After adding a DingTalk bot, copy the webhook address and input it into Alarm Callback by following the stated steps.
  2. Once configured successfully, any triggered alarm notification will be delivered to the DingTalk group.
  • Infoflow
  1. Log in to Infoflow, open the Infoflow group designated to receive alarm notifications.
  2. After adding an Infoflow bot, copy the webhook address and paste it into Alarm Callback following the provided steps.
  3. Once successfully configured, any triggered alarm notification will be sent to the Infoflow group.
  • Zhiyinlou
  1. Log in to Zhiyinlou, open the Zhiyinlou group that will receive alarm notifications.
  2. Complete the form, select the Custom Keywords option in the Security Settings section, and it is recommended to set Alarm as the keyword.

Note: Check the custom keywords box, enter up to 10 keywords, and ensure each message contains at least one keyword for successful delivery. For instance, if Alarm is set as a custom keyword, messages sent by the bot must include the word Alarm to guarantee successful delivery.

  1. After adding an Infoflow bot, copy the webhook address and paste it into Alarm Callback following the provided steps.
  2. Once successfully configured, any triggered alarm notification will be sent to the Infoflow group.
  • Feishu
  1. Log in to Feishu, open the Feishu group that will receive alarm notifications.
  2. After adding an Infoflow bot, copy the webhook address and paste it into Alarm Callback following the provided steps.
  3. Once successfully configured, any triggered alarm notification will be sent to the Infoflow group.
  • Knock
  1. Log in to Knock, open the Knock group that will receive alarm notifications.
  2. After adding an Infoflow bot, copy the webhook address and paste it into Alarm Callback following the provided steps.
  3. Once successfully configured, any triggered alarm notification will be sent to the Infoflow group.

POST method parameter description

Metric alarm POST method parameter description

Parameters Description
alertId Alarm ID
userId Account ID
alarmName Alarm strategy name
scope Cloud product name
policyType Strategy type (Either metric alarm or event alarm, where Metric represents metric alarms and Event represents event alarms)
alertStartTimestamp Alarm timestamp
region Region where the alarm object is located
monitoringObject Alarm object
alarmLevel Alarm level status. Based on actual conditions, return one of the four statuses: critical, notification, important, or warning.
formula Alarm conditions
currentValue Current value of the metric when an alarm occurs or is restored
taskTimestamp Alarm callback sending time
signature Signature
alarmStatus Alarm status: One of four statuses - alarm - abnormal, alarm - repeated notification, alarm - insufficient data, or alarm - closed (return to normal)

Event alarm POST method parameter description

Parameters Description
alarmName Alarm strategy name
scope Cloud product name
alertStartTimestamp Alarm timestamp
alertContent Event Details
taskTimestamp Alarm callback sending time
signature Signature

The signature value is verified by ensuring it matches the MD5 hash of the concatenated string comprising the alertId and taskTimestamp parameters.

URL callback example

Below is an example of URL callback usage, where BCM initiates a POST-style URL callback request:

Plain Text
1POST http://127.0.0.1:8201/callback
2 Request Body (“Content-Type”: “application/json”):
3{
4 “alarmStatus”: “alarm - abnormal”,
5    "alertId":"19925050-3f77-4839-bae7-6a5f721aae0c",
6    "userId":"your_user_id",
7    "alarmName":"test_bcc_alarm",
8    "scope":"BCE_BCC",
9    "policyType":"Metric",
10    "alertStartTimestamp":1698982559,
11 “region”: “Beijing”,
12 “monitoringObject”: “i-6nfua8xc/bcc-test-bj/-(Public)/192.168.16.12(Private)”,
13 “alarmLevel”: “Important”,
14 “Formula”: “CPU average usage >1% within 1 minute”,
15 “currentValue”: “CPU usage=0.50%”,
16    "taskTimestamp":1698982642,
17    "signature":"88e647b853e480046632a5eb9fef70f5"
18}

In callback.java, receive POST parameters and validate messages:

Plain Text
1// Parse 3 parameters - alertId, taskTimestamp, and signature from the received POST requests. The message can be verified using the MD5 hash value generated by concatenating the three parameter strings alertId and taskTimestamp.
2 If the verification is successful, it indicates that the message is sent by Baidu AI Cloud; otherwise, it is regarded as an illegal request and will not be processed. The taskTimestamp can be used for expiration validation. If the time interval between the Timestamp and the user’s current time exceeds a certain period (e.g., 10 minutes), the user may discard the request.
3if (md5(alertId + taskTimestamp) == signature) {
4    ..........
5}

Previous
Alarm Notification Template
Next
Cloud product monitor