Skip to content

关于本页

本页介绍更夫所基于的开源内核 Keep 的通用能力。更夫在其上提供国内化增强:钉钉/企业微信/飞书通知、国产大模型接入、LDAP 认证与值班管理。部署与上手请看快速上手。

Authentication ​

This provider requires authentication.

  • host_url: LibreNMS Host URL (required: True, sensitive: False)
  • api_key: LibreNMS API Key (required: True, sensitive: True)

Certain scopes may be required 可以 perform specific actions or queries via the provider. Below is a summary of relevant scopes and their use cases:

  • read_alerts: Read alerts from LibreNMS

In workflows ​

This provider can't be used as a "step" or "action" in workflows. If you want 可以 use it, please let us know by creating an issue in the GitHub reposi可以ry.

将 LibreNMS 连接到 Keep ​

  1. 打开 LibreNMS 仪表板,点击右上角的设置。
  1. 点击 Create API access token 生成新的 API 密钥。
  1. 为 API 密钥提供描述,然后点击 Create API Token。

Webhooks 集成 ​

  1. 打开 LibreNMS 仪表板,打开导航栏中的 Alerts 选项卡,点击 Alert Transports。
  1. 点击 Create add transport,将 Transport type 选择为 API。将 API Method 选择为 POST。

  2. 将 API URL 填写为 https://api.keephq.dev/alerts/event/libre_nms。

  1. 复制下面的 JSON 并粘贴到 body 字段中。
json
{
  "title": "{{ $title }}",
  "hostname": "{{ $hostname }}",
  "device_id": "{{ $device_id }}",
  "sysDescr": "{{ $sysDescr }}",
  "sysName": "{{ $sysName }}",
  "sysContact": "{{ $sysContact }}",
  "os": "{{ $os }}",
  "type": "{{ $type }}",
  "ip": "{{ $ip }}",
  "display": "{{ $display }}",
  "version": "{{ $version }}",
  "hardware": "{{ $hardware }}",
  "features": "{{ $features }}",
  "serial": "{{ $serial }}",
  "status": "{{ $status }}",
  "status_reason": "{{ $status_reason }}",
  "location": "{{ $location }}",
  "description": "{{ $description }}",
  "notes": "{{ $notes }}",
  "uptime": "{{ $uptime }}",
  "uptime_short": "{{ $uptime_short }}",
  "uptime_long": "{{ $uptime_long }}",
  "elapsed": "{{ $elapsed }}",
  "alerted": "{{ $alerted }}",
  "alert_id": "{{ $alert_id }}",
  "alert_notes": "{{ $alert_notes }}",
  "proc": "{{ $proc }}",
  "rule_id": "{{ $rule_id }}",
  "id": "{{ $id }}",
  "faults": "{{ $faults }}",
  "uid": "{{ $uid }}",
  "severity": "{{ $severity }}",
  "rule": "{{ $rule }}",
  "name": "{{ $name }}",
  "string": "{{ $string }}",
  "timestamp": "{{ $timestamp }}",
  "contacts": "{{ $contacts }}",
  "state": "{{ $state }}",
  "msg": "{{ $msg }}",
  "builder": "{{ $builder }}"
}
  1. 按照以下步骤在 Keep 中创建新的 API 密钥。

  2. 进入 Keep 仪表板,点击左下角的个人资料图标,点击 Settings。

  1. 选择 Users and Access 选项卡,然后选择 API Keys 选项卡,创建一个新的 API 密钥。
  1. 提供名称,选择角色为 webhook,然后点击 Create API Key。
  1. 复制 API 密钥。
  1. 添加一个新的 header,key 为 X-API-KEY,在 Keep 中创建一个新的 API 密钥,并将其作为值粘贴,然后保存 webhook。
  1. 保存 webhook。

  2. 您可以从 LibreNMS 仪表板的 Devices 选项卡添加设备,并选择您创建的告警传输。

  1. 现在,您将在 Keep 中收到告警。

相关链接 ​

基于 MIT 协议开源的 Keep · 由更夫社区维护