侧边栏壁纸
博主头像
Wood Chen博主等级

独唱独酬,独行独坐还独卧

  • 累计撰写 221 篇文章
  • 累计创建 157 个标签
  • 累计收到 8 条评论

目 录CONTENT

文章目录

vigil状态监控项目,怎么进行管理

wood
2023-06-11 / 0 评论 / 0 点赞 / 14 阅读 / 6644 字

AI摘要

本文介绍了一个用于 Vigil 状态管理的单页面应用程序的仓库地址,并提供了使用方法和示例页面。此外,还提供了 Vigil Reporting HTTP API 和 Manager HTTP API 的详细说明,包括列表发布公告、插入新公告、撤回公告、列出探测器警报、解决探测器警报的忽略规则和更新忽略规则等内容。

我写了一个单页面用于管理

仓库地址为:https://github.com/woodchen-ink/vigil_status_manager

使用方法

manager.html​页面放在与你status.example.com​同一个服务下,修改第109行为你自己的网址。然后打开这个网页即可。
image

示例页面

你需要先输入你的manager_token​,然后才能进行其他操作。
image


官方是有文档的,但是很不方便调用:

原文档为:https://github.com/valeriansaliou/vigil/blob/master/PROTOCOL.md#vigil-manager-http-api

Vigil Protocol

Vigil Reporter HTTP API

1️⃣ Report a replica

Endpoint URL:

HTTP POST https://status.example.com/reporter///

Where:

  • node_id​: The parent node of the reporting replica
  • probe_id​: The parent probe of the node

Request headers:

  • Add an Authorization​ header with a Basic​ authentication where the password is your configured reporter_token​.
  • Set the Content-Type​ to application/json; charset=utf-8​, and ensure you submit the request data as UTF-8.

Request data:

Adjust the request data to your replica context and send it as HTTP POST​:

{
  "replica": "",
  "interval": 30,

  "load": {
    "cpu": 0.30,
    "ram": 0.80
  }
}

Where:

  • replica​: The replica unique identifier (eg. the server LAN IP)
  • interval​: The push interval (in seconds)
  • load.cpu​: The general CPU load, from 0.00​ to 1.00​ (can be more than 1.00​ if the CPU is overloaded)
  • load.ram​: The general RAM load, from 0.00​ to 1.00

2️⃣ Flush a replica

Endpoint URL:

HTTP DELETE https://status.example.com/reporter////

Where:

  • node_id​: The parent node of the reporting replica
  • probe_id​: The parent probe of the node
  • replica_id​: The replica unique identifier (eg. the server LAN IP)

Request headers:

  • Add an Authorization​ header with a Basic​ authentication where the password is your configured reporter_token​.

Vigil Manager HTTP API

1️⃣ List published announcements

Endpoint URL:

HTTP GET https://status.example.com/manager/announcements/

Request headers:

  • Add an Authorization​ header with a Basic​ authentication where the password is your configured manager_token​.

2️⃣ Insert a new announcement

Endpoint URL:

HTTP POST https://status.example.com/manager/announcement/

Request headers:

  • Add an Authorization​ header with a Basic​ authentication where the password is your configured manager_token​.
  • Set the Content-Type​ to application/json; charset=utf-8​, and ensure you submit the request data as UTF-8.

Request data:

Adjust the request data to your announcement and send it as HTTP POST​:

{
  "title": "",
  "text": ""
}

Where:

  • title​: The title for the announcement
  • text​: The description text for the announcement (can be multi-line)

3️⃣ Retract a published announcement

Endpoint URL:

HTTP DELETE https://status.example.com/manager/announcement//

Where:

  • announcement_id​: The announcement identifier to be removed

Request headers:

  • Add an Authorization​ header with a Basic​ authentication where the password is your configured manager_token​.

4️⃣ List prober alerts

Endpoint URL:

HTTP GET https://status.example.com/manager/prober/alerts/

Request headers:

  • Add an Authorization​ header with a Basic​ authentication where the password is your configured manager_token​.

5️⃣ Resolve ignore rules for prober alerts

Endpoint URL:

HTTP GET https://status.example.com/manager/prober/alerts/ignored/

Request headers:

  • Add an Authorization​ header with a Basic​ authentication where the password is your configured manager_token​.

6️⃣ Update ignore rules for prober alerts

Endpoint URL:

HTTP PUT https://status.example.com/manager/prober/alerts/ignored/

Request headers:

  • Add an Authorization​ header with a Basic​ authentication where the password is your configured manager_token​.
  • Set the Content-Type​ to application/json; charset=utf-8​, and ensure you submit the request data as UTF-8.

Request data:

Adjust the request data to your announcement and send it as HTTP PUT​:

{
  "reminders_seconds": 600
}

Where:

  • reminders_seconds​: The number of seconds during which downtime reminders should not be sent anymore (skipped)

0

评论区