Skip to content

Status API

Served by charmlab-status on port 8080, LAN only (firewall). Read by the status panel every 10 seconds.

{
"led": { "color": "red", "mode": "fast" },
"summary": "SSD disconnected",
"alerts": [
{ "id": "ssd", "level": "critical", "text": "SSD disconnected", "since": 1764420000 }
],
"node": { "temp_c": 48.5, "cpu": 7, "ram": 38, "emmc": 22, "ssd": null, "uptime_s": 86400 },
"network": { "ip": "192.168.1.20", "eth_mbps": 1000 },
"internet": { "ok": true, "latency_ms": 18 },
"access": { "tailscale": true, "tunnel": true },
"services": [ { "name": "web-app", "ok": false } ]
}
Field Type Meaning
led.color green, yellow, red, blue Color of the most severe state
led.mode solid, slow, fast Blink mode (slow: 1 Hz, fast: 4 Hz)
summary string Headline, already translated: the most severe problem, Starting while the first checks run, or All good
alerts[].id string Stable identifier of the problem (ssd, docker, temp, disk-emmc, disk-ssd, tunnel, backup, internet, service:<name>)
alerts[].level critical, warning Severity
alerts[].text string Text to show, already translated
alerts[].since Unix time, seconds When the problem started
node.temp_c number SoC temperature in °C
node.cpu, node.ram 0 to 100 Usage in percent
node.emmc, node.ssd 0 to 100 or null Disk usage in percent; null when not mounted
node.uptime_s integer Seconds since boot
network.ip string Ethernet IPv4 address
network.eth_mbps integer or null Negotiated link speed
internet.ok boolean At least one of 1.1.1.1 and 8.8.8.8 answered
internet.latency_ms number or null Best round trip of the last check
access.tailscale, access.tunnel boolean Tailscale connected, cloudflared active
services[] list Every service in services.toml with its last result
  • No answer for 30 seconds: the panel shows rock-01 not responding, red with slow blink.

Served by charmlab-status on port 8080 and published only through the tunnel as health.<domain>/health.

Request Answer
Header X-Charmlab-Token: <token> correct 200, body ok
Header missing or wrong 404, empty body
  • The answer only says that charmlab-status is alive and reachable from outside. Problems on the node are reported by charmlab-status itself.

Served by the charmlab-alerts Worker at alerts.<domain>.

Request:

POST /alerts HTTP/1.1
Host: alerts.<domain>
Authorization: Bearer <token>
Content-Type: application/json
{ "level": "critical", "title": "SSD disconnected", "message": "rock-01: /srv missing since 14:32", "source": "charmlab-status" }
Field Rules
level critical, warning or resolved
title 1 to 120 characters
message 1 to 2000 characters
source 1 to 64 characters: letters, digits, ., _ and -

Answers:

Status When Body
202 At least one channel delivered { "delivered": ["telegram", "email"], "failed": [] }
400 Invalid JSON or fields { "error": "invalid_body", "details": [...] }
401 Missing or wrong token { "error": "unauthorized" }
404 Other path { "error": "not_found" }
405 Other method on /alerts { "error": "method_not_allowed" }
413 Content-Length above 16 KiB { "error": "body_too_large" }
415 Content-Type other than application/json { "error": "unsupported_media_type" }
429 More than 30 requests per minute from the same IP { "error": "rate_limited" }
502 Every channel failed { "delivered": [], "failed": [...] }