> ## 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.

# Opmanager 告警事件

> 通过 webhook 的方式同步 Opmanager 告警事件到 Flashduty On-call，实现告警事件自动化降噪处理

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

  您可通过以下两种方式获取集成推送地址，任选其一即可。

  ### 使用专属集成

  如果您只需将告警发往一个协作空间，选择此方式，配置更简单。

  <AccordionGroup>
    <Accordion title="查看专属集成的配置步骤">
      1. 进入 Flashduty 控制台，选择 **协作空间**，打开一个协作空间
      2. 选择 **配置** → **集成数据** → **专属集成**，点击 **新增一个集成**
      3. 选择 **OpManager** 集成，点击 **保存**，生成卡片。
      4. 打开生成的集成卡片，复制 **推送地址**
    </Accordion>
  </AccordionGroup>

  ### 使用共享集成

  如果您需要根据告警事件的 Payload 将告警路由到不同协作空间，选择此方式。

  <AccordionGroup>
    <Accordion title="查看共享集成的配置步骤">
      1. 进入 Flashduty 控制台，选择 **集成中心 → 告警事件**
      2. 选择 **OpManager** 集成：
         * **集成名称**：为当前集成定义一个名称。
      3. 配置默认路由并选择协作空间；创建后可在 **路由** 中增加更多规则
      4. 点击 **保存**，复制生成的 **推送地址**
    </Accordion>
  </AccordionGroup>
</div>

## 在 OpManager

<div className="md-block">
  1. 登录您的 `OpManager` 控制台，在导航菜单中选择 `Settings => Notification Profiles`。

  2. 在 `Notifications` 页面中，点击 `Add` 后选择 `Invoke a Webhook` 添加配置文件。

       <img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/opm-1.png" />

  3. 开始在 Webhook 编辑页面进行配置具体内容。

  4. `Hook URL` 中的请求方法选择 `POST`，`URL` 填写**告警集成的推送地址**。

  5. `Data Type` 选择 `raw`，`Payload Type` 选择 `JSON`。

  6. `Body Content` 填写以下内容：

  ```
  {
       "alarmid":"$alarmid",
       "message":"$message",
       "displayName":"$displayName",
       "category":"$category",
       "severity":"$stringseverity",
       "strModTime":"$strModTime",
       "eventType":"$eventType",
       "entity":"$entity",
       "lastPolledValue":"$lastPolledValue",
       "Intf_ifDescr":"$IntfField(ifDescr)",
       "Intf_displayName":"$IntfField(displayName)",
       "Intf_ifAlias":"$IntfField(ifAlias)",
       "Intf_ifName":"$IntfField(ifName)",
       "Intf_ipAddress":"$IntfField(ipAddress)",
       "Intf_physMedia":"$IntfField(physMedia)",
       "Intf_ifIndex(ifIndex)":"$IntfField(ifIndex)",
       "Intf_ifCircuitID(ifCircuitID)":"$IntfField(ifCircuitID)",
       "Intf_ifSpeedIn(ifSpeedIn)":"$IntfField(ifSpeedIn)",
       "Intf_ifSpeedOut(ifSpeedOut)":"$IntfField(ifSpeedOut)",
       "Intf_lineID":"$IntfCustomField(Circuit ID)",
       "Intf_note":"$IntfCustomField(Comments)",
       "Intf_contacts":"$IntfCustomField(Contact Name)",
       "Intf_SLA":"$IntfCustomField(SLA)",
       "Custom_BuildingNo":"$CustomField(Building)",
       "Custom_cabinet":"$CustomField(Cabinet)",
       "Custom_note":"$CustomField(Comments)",
       "Custom_contacts":"$CustomField(Contact Name)",
       "Custom_department":"$CustomField(Department)",
       "Custom_RoomNo":"$CustomField(Floor)",
       "Custom_serial":"$CustomField(SerialNumbe)",
       "Monitor_monitorName":"$MonitorField(monitorName)",
       "Monitor_instance":"$MonitorField(instance)",
       "Monitor_protocol":"$MonitorField(protocol)",
       "Device_type":"$DeviceField(type)",
       "Device_ipAddress":"$DeviceField(ipAddress)",
       "Device_isSNMP":"$DeviceField(isSNMP)",
       "Device_dependent":"$DeviceField(dependent)",
       "Device_hardDiskSize":"$DeviceField(hardDiskSize)",
       "Device_ramSize":"$DeviceField(ramSize)"
  }
  ```

  **特殊说明** ：暂不支持添加额外的自定义字段，即使在 Body Content 中引用了自定义字段，也不会生效。

  7. `Request Headers` 保持默认的即可。

  8. `Time Out` 填写 1-300 之间的任意值，并点击下一步。

       <img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/opm-2.png" />

  9. 在 `Choose the criteria` 配置条件页面中勾选 `Notify when the alarm is cleared`，其他按需配置即可。

       <img alt="drawing" width="600" src="https://download.flashcat.cloud/flashduty/doc/opm-3.png" />

  10. 选择希望应用此配置文件的设备，使用右箭头将它们移动到选定设备窗口，然后点击下一步。

  11. Time Window/Delayed Trigger/Recurring Trigger 可按需配置，然后点击下一步。

  12. 为该配置文件添加名称 `Flashduty`，然后点击 `Save` 保存即可完成配置。
</div>

## 状态对照

<div className="md-block">
  | OpManager | Flashduty | 状态 |
  | - | - | - |
  | Critical | Critical | 严重 |
  | Service Down | Critical | 严重 |
  | Trouble | Warning | 警告 |
  | Attention | Info | 提醒 |
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.