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

# SolarWinds 告警事件

> 通过 webhook 的方式同步 SolarWinds 告警事件到 Flashduty On-call

通过 webhook 的方式同步 SolarWinds 告警事件到 Flashduty On-call。

## 在 Flashduty On-call

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

### 使用专属集成

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

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

### 使用共享集成

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

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

## 在 SolarWinds 中配置

SolarWinds 的告警类型有五种（Anomaly、Entity、Event、Log、Metric Group），每种类型对应不同的告警通道，所以需要创建五个 Webhook 通道，分别用于不同类型的告警。

**1. 在 SolarWinds 中创建 Webhook 通知服务**

**操作路径**：SolarWinds › Settings › Notification Services › Webhook › CREATE CONFIGURATION

| 字段 | 填写 |
| - | - |
| Method（必填） | `POST` |
| Name（必填） | 建议使用 `类型_Flashduty` 的形式，例如 `Anomaly_Flashduty` |
| Destination URL（必填） | `{integration_url}`（在 Flashduty 填写集成名称并保存后生成） |
| Content Type（必填） | `application/json` |
| Select Custom Body Template Based On The Alert Types（必填） | 要创建的类型，例如 Anomaly Based Alert |
| HTTP POST Body | 系统会按所选类型自动生成，**请不要修改生成的模板内容** |

填写后点击 **CREATE**。

![drawing](https://download.flashcat.cloud/flashduty/doc/sw-1.png)

![drawing](https://download.flashcat.cloud/flashduty/doc/sw-2.png)

如需创建其他类型的 Webhook 通道，重复以上操作。

**2. 在 SolarWinds 告警策略中使用该通道**

**操作路径**：SolarWinds › Alerts › Alert Settings › 创建或编辑告警策略 › Actions

告警规则按需配置，此处省略。在 **Actions** 部分：

| 字段 | 填写 |
| - | - |
| Services（必填） | `Webhook` |
| Configuration（必填） | 上一步创建的通道，例如 `Anomaly_Flashduty`（类型须与告警类型对应） |
| Send an additional notification when the Alert is cleared | 保持开启，Flashduty 才能收到恢复通知 |

其他配置完成后点击 **Save**。

![drawing](https://download.flashcat.cloud/flashduty/doc/sw-4.png)

**3. 触发告警并确认**

**操作路径**：SolarWinds › Alerts › Alert Settings

创建 Webhook 通道时 SolarWinds 提供的测试通知只能证明 Flashduty 地址可连通，不能代替真实告警验证。请让一条已关联该通道的告警规则真实触发，几秒后回到 Flashduty，集成显示 **最新事件时间**，说明配置成功；条件恢复后，原告警自动恢复。

## 状态和告警等级

| SolarWinds | Flashduty |
| - | - |
| Critical | Critical |
| Warning | Warning |
| Info | Info |

其他取值按 Info 处理；SolarWinds 发出清除通知时告警恢复。


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