|
| 1 | +--- |
| 2 | +title: "Huawei Cloud AOM alert integration" |
| 3 | +description: "Send Huawei Cloud AOM alerts to Flashduty On-call through SMN notifications or AOM webhook data subscriptions" |
| 4 | +keywords: ["alert integration", "Huawei Cloud AOM", "SMN", "webhook", "data ingestion"] |
| 5 | +--- |
| 6 | + |
| 7 | +Huawei Cloud Application Operations Management (AOM) can send triggered and recovered alerts to Flashduty On-call through Simple Message Notification (SMN) or webhook data subscriptions. Both methods use the same AOM integration push URL. |
| 8 | + |
| 9 | +<Info> |
| 10 | +Use **SMN notifications** for most accounts. AOM webhook data subscription is not generally available and should only be used when Huawei Cloud has enabled it for your account. |
| 11 | +</Info> |
| 12 | + |
| 13 | +<div className="hide"> |
| 14 | + |
| 15 | +## Create an integration in Flashduty On-call |
| 16 | + |
| 17 | +Use either of the following methods to obtain an integration push URL. |
| 18 | + |
| 19 | +### Use a dedicated integration |
| 20 | + |
| 21 | +Use this method when you do not need to route alerts to different channels. |
| 22 | + |
| 23 | +<AccordionGroup> |
| 24 | + <Accordion title="Expand"> |
| 25 | + 1. In the Flashduty console, select **Channels** and open the target channel. |
| 26 | + 2. Select **Integrations** and click **Add integration**. |
| 27 | + 3. Select **Huawei Cloud AOM** and click **Save**. |
| 28 | + 4. Open the generated integration card and copy the **push URL**. |
| 29 | + </Accordion> |
| 30 | +</AccordionGroup> |
| 31 | + |
| 32 | +### Use a shared integration |
| 33 | + |
| 34 | +Use this method when you need to route alerts to different channels based on their payload. |
| 35 | + |
| 36 | +<AccordionGroup> |
| 37 | + <Accordion title="Expand"> |
| 38 | + 1. In the Flashduty console, select **Integration Center > Alert events**. |
| 39 | + 2. Select **Huawei Cloud AOM** and enter an integration name. |
| 40 | + 3. Configure the default route and select a channel. You can add more routing rules under **Routes** after creating the integration. |
| 41 | + 4. Click **Save** and copy the generated **push URL**. |
| 42 | + </Accordion> |
| 43 | +</AccordionGroup> |
| 44 | + |
| 45 | +</div> |
| 46 | + |
| 47 | +## Prerequisites |
| 48 | + |
| 49 | +- You have created a **Huawei Cloud AOM** integration in Flashduty and obtained its HTTPS push URL. |
| 50 | +- You have created or prepared an AOM alarm rule. |
| 51 | +- To use SMN, your Huawei Cloud account can create topics, subscribe endpoints, and list topics. |
| 52 | +- The alarm rule sends notifications for both **alarm triggered** and **alarm recovered**. |
| 53 | + |
| 54 | +## Method 1: Use SMN |
| 55 | + |
| 56 | +### Create an SMN topic and subscription |
| 57 | + |
| 58 | +<Steps> |
| 59 | + <Step title="Create an SMN topic"> |
| 60 | +1. Sign in to the Huawei Cloud console and open **Simple Message Notification (SMN)**. |
| 61 | +2. Select **Topic Management > Topics** and click **Create Topic**. |
| 62 | +3. Set the topic name to **Flashduty** and save it. |
| 63 | + |
| 64 | + <Frame> |
| 65 | + <img src="https://download.flashcat.cloud/flashduty/doc/en/hw/lts-1.png" alt="Create a Flashduty topic in Huawei Cloud SMN" /> |
| 66 | + </Frame> |
| 67 | + </Step> |
| 68 | + |
| 69 | + <Step title="Add an HTTPS subscription"> |
| 70 | +1. Open the Flashduty topic and click **Add Subscription**. |
| 71 | +2. Select **HTTPS** as the protocol. |
| 72 | +3. Enter the Flashduty AOM integration **push URL** as the endpoint and save the subscription. |
| 73 | + |
| 74 | + <Frame> |
| 75 | + <img src="https://download.flashcat.cloud/flashduty/doc/en/hw/lts-3.png" alt="Add the Flashduty HTTPS endpoint to an SMN topic" /> |
| 76 | + </Frame> |
| 77 | + |
| 78 | + Flashduty verifies the SMN confirmation request and automatically visits the Huawei Cloud confirmation URL. SMN starts sending alerts after the subscription status changes to **Confirmed**. |
| 79 | + </Step> |
| 80 | +</Steps> |
| 81 | + |
| 82 | +### Configure an AOM message template |
| 83 | + |
| 84 | +In the AOM 2.0 console, go to **Alarm Center > Alarm Notifications > Message Templates**. In some console versions, the path is **Alarms > Alarm Action Rules > Message Templates**. |
| 85 | + |
| 86 | +When creating the template, select **HTTP/HTTPS** as the notification method. Flashduty supports the following content formats: |
| 87 | + |
| 88 | +<Tabs> |
| 89 | + <Tab title="HTML"> |
| 90 | + HTML templates can be in Chinese or English. Add the report type as the first line so that Flashduty can reliably distinguish triggered and recovered alerts. |
| 91 | + |
| 92 | + **Chinese template** |
| 93 | + |
| 94 | + ~~~text |
| 95 | + 上报类型:${clear_type}; |
| 96 | + 通知类型:${event_type}; |
| 97 | + 事件级别:${event_severity}; |
| 98 | + 事件名称:${event_name_alias}; |
| 99 | + 发生时间:${starts_at}; |
| 100 | + 事件源:$event.metadata.resource_provider; |
| 101 | + 资源类型:$event.metadata.resource_type; |
| 102 | + 资源标识:${resources_new}; |
| 103 | + 可能原因:${alarm_probableCause_zh}; |
| 104 | + 附加信息:${message}; |
| 105 | + 修复建议:${alarm_fix_suggestion_zh}; |
| 106 | + ~~~ |
| 107 | + |
| 108 | + **English template** |
| 109 | + |
| 110 | + ~~~text |
| 111 | + Clear Type:${clear_type}; |
| 112 | + Alarm Name:${event_name_alias}; |
| 113 | + Alarm ID:${id}; |
| 114 | + Notification Rule:${action_rule}; |
| 115 | + Occurred:${starts_at}; |
| 116 | + Event Severity:${event_severity}; |
| 117 | + Alarm Info:${alarm_info}; |
| 118 | + Resource Identifier:${resources_new}; |
| 119 | + Suggestion:${alarm_fix_suggestion_zh}; |
| 120 | + ~~~ |
| 121 | + |
| 122 | + <Tip> |
| 123 | + Put each field on a separate line and keep the trailing semicolon. A resource identifier can span multiple lines. Flashduty parses its key-value pairs into labels. |
| 124 | + </Tip> |
| 125 | + </Tab> |
| 126 | + |
| 127 | + <Tab title="JSON"> |
| 128 | + After selecting **JSON**, keep the default JSON content generated by AOM. Flashduty parses this JSON from the <code>message</code> field in the outer SMN notification. |
| 129 | + |
| 130 | + The default AOM JSON contains the following core fields. Keep every field marked as required. Flashduty uses optional fields for labels or recovery detection when they have a value. |
| 131 | + |
| 132 | + | Field | Required | Purpose | |
| 133 | + | --- | --- | --- | |
| 134 | + | `id` | No | AOM event ID; stored as the `event_id` label when present | |
| 135 | + | `starts_at` | Yes | Trigger time as a Unix timestamp in milliseconds | |
| 136 | + | `ends_at` | No | A value greater than 0 indicates recovery; a missing, empty, or 0 value falls back to the SMN subject | |
| 137 | + | `metadata.event_name` | Yes | Alert name | |
| 138 | + | `metadata.event_severity` | Yes | Alert severity | |
| 139 | + | `metadata.event_type` | Yes | Event type, usually `alarm` | |
| 140 | + | `metadata.resource_provider` | Yes | Event source, such as `AOM` or `CCE` | |
| 141 | + | `metadata.resource_type` | Yes | Resource type | |
| 142 | + | `metadata.resource_id` | Yes | Resource identifier | |
| 143 | + |
| 144 | + <Warning> |
| 145 | + Do not manually add SMN envelope fields such as <code>signature</code>, <code>subject</code>, or <code>topic_urn</code> to the AOM JSON template. SMN generates the outer notification and its signature. |
| 146 | + </Warning> |
| 147 | + </Tab> |
| 148 | +</Tabs> |
| 149 | + |
| 150 | +### Create an alarm notification rule |
| 151 | + |
| 152 | +<Steps> |
| 153 | + <Step title="Associate the SMN topic and message template"> |
| 154 | +1. In the AOM 2.0 console, go to **Alarm Center > Alarm Notifications**. |
| 155 | +2. Under **Notification Rule Management**, create an alarm notification rule. |
| 156 | +3. Select the **Flashduty** SMN topic and the AOM message template created earlier. |
| 157 | + </Step> |
| 158 | + |
| 159 | + <Step title="Send triggered and recovered notifications"> |
| 160 | + Enable notifications in the AOM alarm rule and make sure that the notification scenarios include both **alarm triggered** and **alarm recovered**. |
| 161 | + </Step> |
| 162 | + |
| 163 | + <Step title="Verify the integration"> |
| 164 | + Trigger a test alert and then recover it. In Flashduty, verify that the integration's latest event time has changed and that the alert details contain the expected severity, resource, and recovery status. |
| 165 | + </Step> |
| 166 | +</Steps> |
| 167 | + |
| 168 | +## Method 2: Use an AOM webhook data subscription |
| 169 | + |
| 170 | +<Warning> |
| 171 | +AOM webhook data subscription is not generally available. If the webhook alarm subscription option is not available in your console, submit a Huawei Cloud service ticket or use SMN instead. |
| 172 | +</Warning> |
| 173 | + |
| 174 | +If Huawei Cloud has enabled this feature for your account, go to **Settings > Global Settings > Data Subscription** in the AOM 2.0 console. Create a webhook alarm subscription and set its destination to the same Flashduty AOM integration push URL. |
| 175 | + |
| 176 | +The webhook request must use the official AOM structured event format: |
| 177 | + |
| 178 | +~~~json |
| 179 | +{ |
| 180 | + "events": [ |
| 181 | + { |
| 182 | + "id": "4346299651651991683", |
| 183 | + "starts_at": 1664001830491, |
| 184 | + "ends_at": 0, |
| 185 | + "timeout": 300000, |
| 186 | + "resource_group_id": "project-id", |
| 187 | + "metadata": { |
| 188 | + "event_name": "Pod memory OOM", |
| 189 | + "event_severity": "Major", |
| 190 | + "event_type": "alarm", |
| 191 | + "resource_provider": "CCE", |
| 192 | + "resource_type": "service", |
| 193 | + "resource_id": "clusterName=production;kind=Pod;namespace=default;name=example;uid=example-uid" |
| 194 | + }, |
| 195 | + "annotations": { |
| 196 | + "alarm_probableCause_en_us": "The pod does not have enough memory", |
| 197 | + "message": "pod was OOM killed", |
| 198 | + "alarm_fix_suggestion_en_us": "Increase the container memory limit" |
| 199 | + } |
| 200 | + } |
| 201 | + ], |
| 202 | + "project_id": "project-id" |
| 203 | +} |
| 204 | +~~~ |
| 205 | + |
| 206 | +A request can contain up to 100 events. Each structured event must contain a valid <code>id</code>, <code>starts_at</code>, and all six required <code>metadata</code> fields. |
| 207 | + |
| 208 | +## Correlate triggered and recovered alerts |
| 209 | + |
| 210 | +Flashduty detects recovery in the following order: |
| 211 | + |
| 212 | +| Input format | Recovery detection | |
| 213 | +| --- | --- | |
| 214 | +| SMN HTML | Read `上报类型` or `Clear Type` first; if the value is missing or unknown, inspect the SMN `subject` | |
| 215 | +| SMN JSON | `ends_at > 0` indicates recovery; if it is missing, empty, or 0, inspect the SMN `subject` | |
| 216 | +| Webhook data subscription | `ends_at > 0` indicates recovery | |
| 217 | + |
| 218 | +For Huawei Cloud message templates, the Chinese `clear_type` values are `触发` and `恢复`, and the English values are `generated` and `cleared`. Flashduty uses these values first to distinguish triggered and recovered alerts. |
| 219 | + |
| 220 | +<Note> |
| 221 | +If an SMN HTML message does not contain a recognized report type, a subject containing <code>恢复</code>, <code>_resolved</code>, <code>_recovered</code>, or <code>_clear</code> is treated as a recovery. |
| 222 | +</Note> |
| 223 | + |
| 224 | +The following fields must remain the same between a triggered alert and its recovery: |
| 225 | + |
| 226 | +- <code>metadata.event_type</code> |
| 227 | +- <code>metadata.event_name</code> |
| 228 | +- <code>metadata.resource_provider</code> |
| 229 | +- <code>metadata.resource_type</code> |
| 230 | +- <code>metadata.resource_id</code> |
| 231 | + |
| 232 | +Flashduty generates the alert fingerprint from these fields. The <code>id</code> is stored as a label but does not participate in correlation, so triggered and recovered notifications may have different IDs. |
| 233 | + |
| 234 | +If two independent alerts have identical values for all five fields, Flashduty treats them as the same alert. Make sure that <code>metadata.event_name</code> or <code>metadata.resource_id</code> distinguishes alerts that must be handled separately. |
| 235 | + |
| 236 | +## Field and severity mappings |
| 237 | + |
| 238 | +Common AOM fields are converted into Flashduty labels: |
| 239 | + |
| 240 | +| AOM field | Flashduty label | |
| 241 | +| --- | --- | |
| 242 | +| `id` | `event_id` | |
| 243 | +| `metadata.event_name` | `event_name` and `check` | |
| 244 | +| `metadata.event_severity` | `event_severity` | |
| 245 | +| `metadata.resource_provider` | `resource_provider` | |
| 246 | +| `metadata.resource_type` | `resource_type` | |
| 247 | +| `metadata.resource_id` | `resource_id`, plus labels parsed from its resource key-value pairs | |
| 248 | +| `policy.alarm_rule_name` | `alarm_rule_name` | |
| 249 | +| `annotations.tms_tags` | `tms_tags` | |
| 250 | +| `annotations.generator_url` | `generator_url` | |
| 251 | +| `Notification Rule` in the English HTML template | `notification_rule` | |
| 252 | + |
| 253 | +Severity mapping: |
| 254 | + |
| 255 | +| AOM severity | Flashduty severity | Status | |
| 256 | +| --- | --- | --- | |
| 257 | +| Critical, Major, 紧急, or 重要 | Critical | Critical | |
| 258 | +| Minor, Warning, 次要, or 警告 | Warning | Warning | |
| 259 | +| Info or 提示 | Info | Info | |
| 260 | + |
| 261 | +## Troubleshooting |
| 262 | + |
| 263 | +<AccordionGroup> |
| 264 | + <Accordion title="Why does the SMN subscription remain unconfirmed?"> |
| 265 | + Make sure that the endpoint is the complete HTTPS integration push URL and that its <code>integration_key</code> has not been changed. Flashduty only visits valid Huawei Cloud HTTPS confirmation URLs. |
| 266 | + </Accordion> |
| 267 | + |
| 268 | + <Accordion title="Why does a manually replayed SMN request fail signature verification?"> |
| 269 | + The SMN <code>signature</code> is bound to the message body, message ID, <code>subject</code>, topic, timestamp, and message type. Changing any of these fields invalidates the original signature. Send a real test notification through AOM and SMN instead of modifying a historical request. |
| 270 | + </Accordion> |
| 271 | + |
| 272 | + <Accordion title="Why did the recovery not close the alert?"> |
| 273 | + Make sure that the alarm rule sends recovery notifications. Add <code>${clear_type}</code> to an HTML template. For SMN JSON, Flashduty first checks for an <code>ends_at</code> value greater than 0 and falls back to the <code>subject</code> when the value is missing, empty, or 0. A webhook data subscription must provide an <code>ends_at</code> value greater than 0. Also verify that the five correlation fields are identical in the triggered and recovered events. |
| 274 | + </Accordion> |
| 275 | + |
| 276 | + <Accordion title="What is the difference between SMN JSON and a webhook data subscription?"> |
| 277 | + SMN JSON is carried in the <code>message</code> field of an SMN notification, whose outer object still contains a signature and subject. A webhook data subscription directly sends an <code>{"events":[...]}</code> object without SMN fields. Do not combine both outer formats in one request. |
| 278 | + </Accordion> |
| 279 | +</AccordionGroup> |
| 280 | + |
| 281 | +## Huawei Cloud references |
| 282 | + |
| 283 | +- [Creating an AOM alarm notification rule](https://support.huaweicloud.com/intl/en-us/usermanual-aom2/mon_01_0015.html) |
| 284 | +- [Configuring message templates](https://support.huaweicloud.com/intl/en-us/bestpractice-aom2/aom_05_0023.html) |
| 285 | +- [Subscribing to AOM metrics or alarms](https://support.huaweicloud.com/intl/en-us/usermanual-aom2/mon_01_0039.html) |
| 286 | +- [Pushing event data](https://support.huaweicloud.com/intl/en-us/api-aom/PushEvents.html) |
0 commit comments