> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashduty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# China Mobile Cloud (ecloud) Cloud Monitor integration

> Sync China Mobile Cloud Cloud Monitor alerts to Flashduty On-call through the custom webhook of an alarm contact. Alerts close automatically when they recover.

Push China Mobile Cloud (ecloud) Cloud Monitor alerts to Flashduty On-call through the custom webhook address of an alarm contact. Alerts that the same rule keeps raising on the same resource map to one Flashduty alert: the alert opens when it triggers and recovers automatically when China Mobile Cloud pushes the recovery.

<div className="hide">
  ## In Flashduty On-call

  ***

  You can obtain an integration push URL in either of the following ways.

  ### Use a dedicated integration

  1. In the Flashduty console, select **Channel** and open a channel
  2. Select **Configuration** → **Integrations** → **Private integration**, then click **Add an integration**
  3. Select **China Mobile Cloud**, then click **Save**
  4. Open the generated integration card and copy the **Push URL**

  ### Use a shared integration

  1. In the Flashduty console, select **Integration Center → Alert Events**
  2. Select **China Mobile Cloud** and enter an integration name
  3. Configure the default route and select a channel; after creation, add more rules under **Route** if needed
  4. Click **Save** and copy the generated **Push URL**
</div>

## In China Mobile Cloud

***

<Steps>
  <Step title="Create an alarm contact with a webhook address">
    1. Sign in to the China Mobile Cloud console and go to **云监控 (Cloud Monitor)** → **告警服务 (Alarm service)** → **告警联系人 (Alarm contacts)**
    2. Click **新建告警联系人 (Create alarm contact)** and enter the contact's name, mobile number, and email
    3. Paste the full Flashduty integration push URL into **自定义webhook地址 (Custom webhook address)**. The URL must include `integration_key`
    4. Save the contact

    China Mobile Cloud requires the webhook address to be reachable from the public internet. The Flashduty push URL meets this requirement.
  </Step>

  <Step title="Notify the contact from an alarm policy">
    1. Go to **云监控 (Cloud Monitor)** → **告警服务 (Alarm service)** → **告警策略 (Alarm policies)**, then create or edit an alarm policy
    2. Select the alarm contact created in the previous step as a notification recipient and save the policy

    When an alarm rule in the policy triggers or recovers, China Mobile Cloud pushes the alarm to the contact's webhook address.
  </Step>

  <Step title="Verify">
    1. Make an alarm rule in the policy trigger, for example by temporarily lowering the threshold of a CPU utilization rule on a cloud server, and confirm that Flashduty receives an active alert
    2. Restore the threshold. After the monitoring data returns to normal and China Mobile Cloud pushes the recovery, confirm that the original alert recovers
  </Step>
</Steps>

## Alert Key

***

Every push from China Mobile Cloud carries an alarm ID (`alarmId`). According to China Mobile Cloud, `alarmId` stays the same for alarms that the same rule keeps raising on the same resource. Flashduty computes the Alert Key from `alarmId`, so:

* Repeated pushes and the recovery push for the same resource and alarm rule go to the same alert
* When one alarm rule applies to several resources, each resource gets its own alert
* Changes to the alarm level, alarm content, trigger value, or time do not change the Alert Key

Requests without `alarmId` are rejected.

## Status and severity

***

The alert recovers when `recover` is `true`. Any other value is treated as a trigger. The severity comes from the alarm level (`alarmLevel`):

| China Mobile Cloud alarm level | Flashduty severity |
| :- | :- |
| 严重 (Critical) | Critical |
| 重要 (Major) | Warning |
| 次要 (Minor) | Info |
| 提示 (Notice) | Info |
| Empty or any other value | Warning |

A recovered alert keeps the severity it had before recovery.

## Alert content and labels

***

The alert title combines the resource name (`resourceName`) and the metric name (`metricName`), for example `ECS-45273803 CPU利用率`. The alert description is the alarm content (`content`) pushed by China Mobile Cloud, which includes the trigger value and trigger time.

| Label | Source |
| :- | :- |
| `check` | Metric name (`metricName`) |
| `resource` | Resource name (`resourceName`) |
| `resource_id` | Resource ID (`resourceId`) |
| `product_type` | Resource type (`productType`), such as `云主机 ECS` |
| `region` | Resource pool of the resource (`poolName`), such as `湖北-襄阳` |
| `pool_id` | Resource pool ID (`poolId`) |
| `ip_infos` | Resource IP information (`ipInfos`), sent for cloud servers (ECS) only |
| `child_node` | Child node name (`childNode`), sent for child-node alarms only |
| `alarm_id` | Alarm ID (`alarmId`) |
| `alarm_type` | Alarm type (`alarmTypeCn`) |
| `alarm_level` | Original alarm level in China Mobile Cloud |
| `rule_id` | Alarm rule ID (`ruleId`); not sent when the rules in a policy are combined with AND |
| `strategy_id` | Alarm policy ID (`strategyId`) |
| `user_name` | China Mobile Cloud user name (`userName`) |
| `notify_time` | Time of this alarm notification (`notifyTime`) |

## Troubleshooting

***

* **Flashduty receives no alerts**: Confirm that the alarm policy notifies the alarm contact that has the webhook address, and that the address is complete and includes `integration_key`
* **Flashduty returns a parameter error**: Confirm that the pushed content includes `alarmId`
* **The alert does not recover**: China Mobile Cloud pushes a recovery when the monitoring data returns to normal and it clears the real-time alarm automatically. If an alarm that ended another way (for example, a manual clear) pushes no recovery, close the corresponding alert in Flashduty manually
* **All alerts have Warning severity**: Check `alarmLevel` in the pushed content and see the status and severity section above

For a full description of the pushed fields, see the Cloud Monitor **告警联系人 (Alarm contacts)** document in the China Mobile Cloud help center.
