How to Manage the Vigil Status Monitoring Project
This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文
AI Summary
This article introduces the repository for a single-page application for managing Vigil status, along with usage instructions and example pages. It also provides detailed documentation for the Vigil Reporter HTTP API and Manager HTTP API, covering listing published announcements, inserting new announcements, retracting announcements, listing probe alerts, and managing and updating ignore rules for probe alerts.
I built a single-page management app
Repository: https://github.com/woodchen-ink/vigil_status_manager
Usage
Host the manager.html page on the same service as your status.example.com, and change line 109 to your own URL. Then open the page.
Example page
You need to enter your manager_token before performing any other operations.
Official documentation exists, but making API calls is inconvenient:
Original documentation: 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 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": "",
"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
2️⃣ Flush a replica
Endpoint URL:
HTTP DELETE https://status.example.com/reporter////
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
1️⃣ 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.
2️⃣ 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": "",
"text": "<text>"
}</code></pre><p>Where:</p><ul><li><code>title</code>: The title for the announcement</li><li><code>text</code>: The description text for the announcement (can be multi-line)</li></ul><h4>3️⃣ Retract a published announcement</h4><p><strong>Endpoint URL:</strong></p><p><code>HTTP DELETE https://status.example.com/manager/announcement/<announcement_id>/</code></p><p>Where:</p><ul><li><code>announcement_id</code>: The announcement identifier to be removed</li></ul><p><strong>Request headers:</strong></p><ul><li>Add an <code>Authorization</code> header with a <code>Basic</code> authentication where the password is your configured <code>manager_token</code>.</li></ul><h4>4️⃣ List prober alerts</h4><p><strong>Endpoint URL:</strong></p><p><code>HTTP GET https://status.example.com/manager/prober/alerts/</code></p><p><strong>Request headers:</strong></p><ul><li>Add an <code>Authorization</code> header with a <code>Basic</code> authentication where the password is your configured <code>manager_token</code>.</li></ul><h4>5️⃣ Resolve ignore rules for prober alerts</h4><p><strong>Endpoint URL:</strong></p><p><code>HTTP GET https://status.example.com/manager/prober/alerts/ignored/</code></p><p><strong>Request headers:</strong></p><ul><li>Add an <code>Authorization</code> header with a <code>Basic</code> authentication where the password is your configured <code>manager_token</code>.</li></ul><h4>6️⃣ Update ignore rules for prober alerts</h4><p><strong>Endpoint URL:</strong></p><p><code>HTTP PUT https://status.example.com/manager/prober/alerts/ignored/</code></p><p><strong>Request headers:</strong></p><ul><li>Add an <code>Authorization</code> header with a <code>Basic</code> authentication where the password is your configured <code>manager_token</code>.</li><li>Set the <code>Content-Type</code> to <code>application/json; charset=utf-8</code>, and ensure you submit the request data as UTF-8.</li></ul><p><strong>Request data:</strong></p><p>Adjust the request data to your announcement and send it as <code>HTTP PUT</code>:</p><pre><code class="lang-json">{
"reminders_seconds": 600
}</code></pre><p>Where:</p><ul><li><code>reminders_seconds</code>: The number of seconds during which downtime reminders should not be sent anymore (skipped)</li></ul><hr><p></p>
Last updated 2024-01-14
Comments 0