我写了一个单页面用于管理
仓库地址为:https://github.com/woodchen-ink/vigil_status_manager
使用方法
将manager.html页面放在与你status.example.com同一个服务下,修改第109行为你自己的网址。然后打开这个网页即可。
示例页面
你需要先输入你的manager_token,然后才能进行其他操作。
官方是有文档的,但是很不方便调用:
原文档为: https://github.com/valeriansaliou/vigil/blob/master/PROTOCOL.md#vigil-manager-http-api
Vigil Protocol
Vigil Reporter HTTP API
Report a replica
Endpoint URL:
HTTP POST https://status.example.com/reporter/<probe_id>/<node_id>/
Where:
node_id: The parent node of the reporting replicaprobe_id: The parent probe of the node
Request headers:
- Add an
Authorizationheader with aBasicauthentication where the password is your configuredreporter_token. - Set the
Content-Typetoapplication/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": "<replica_id>",
"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, from0.00to1.00(can be more than1.00if the CPU is overloaded)load.ram: The general RAM load, from0.00to1.00
Flush a replica
Endpoint URL:
HTTP DELETE https://status.example.com/reporter/<probe_id>/<node_id>/<replica_id>/
Where:
node_id: The parent node of the reporting replicaprobe_id: The parent probe of the nodereplica_id: The replica unique identifier (eg. the server LAN IP)
Request headers:
- Add an
Authorizationheader with aBasicauthentication where the password is your configuredreporter_token.
Vigil Manager HTTP API
List published announcements
Endpoint URL:
HTTP GET https://status.example.com/manager/announcements/
Request headers:
- Add an
Authorizationheader with aBasicauthentication where the password is your configuredmanager_token.
Insert a new announcement
Endpoint URL:
HTTP POST https://status.example.com/manager/announcement/
Request headers:
- Add an
Authorizationheader with aBasicauthentication where the password is your configuredmanager_token. - Set the
Content-Typetoapplication/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": "<title>",
"text": "<text>"
}
Where:
title: The title for the announcementtext: The description text for the announcement (can be multi-line)
Retract a published announcement
Endpoint URL:
HTTP DELETE https://status.example.com/manager/announcement/<announcement_id>/
Where:
announcement_id: The announcement identifier to be removed
Request headers:
- Add an
Authorizationheader with aBasicauthentication where the password is your configuredmanager_token.
List prober alerts
Endpoint URL:
HTTP GET https://status.example.com/manager/prober/alerts/
Request headers:
- Add an
Authorizationheader with aBasicauthentication where the password is your configuredmanager_token.
Resolve ignore rules for prober alerts
Endpoint URL:
HTTP GET https://status.example.com/manager/prober/alerts/ignored/
Request headers:
- Add an
Authorizationheader with aBasicauthentication where the password is your configuredmanager_token.
Update ignore rules for prober alerts
Endpoint URL:
HTTP PUT https://status.example.com/manager/prober/alerts/ignored/
Request headers:
- Add an
Authorizationheader with aBasicauthentication where the password is your configuredmanager_token. - Set the
Content-Typetoapplication/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)