Why it exists
Grafana is good at history and Cockpit is good at one host at a time. Neither answers the question I ask most often: are all the boxes up, and what are they running right now? The dashboard needed to fit on one screen, load fast over a tailnet, and be honest when a machine stops responding.
That last part drove the design. A dashboard that blanks a card when a poll fails looks the same as a dashboard that is broken. Mission Control keeps the last good telemetry, labels it, and tells you how old it is. A silent gap becomes a visible state change.
One screen, three nodes
Each card carries the same shape: operating system, kernel, CPU model, total memory and storage, GPU, uptime, then four utilisation bars and a list of containers or services. The bars are a quick read, not a monitoring system. If something looks wrong, the card is the entry point to Grafana, Cockpit, or an SSH session.
The node list is deliberately short. Three hosts is the whole lab that runs the dashboard agent. Adding a fourth means deploying the agent and adding a config entry, but the page is designed for a glance, not for a wall display.
The agent
One Python file runs on every host under systemd. It uses only the standard library, so deploying it means copying a file and starting a unit, with no virtualenv to rebuild when a host is reinstalled. It serves a small JSON payload over the tailnet and the dashboard polls it.
- CPU, memory, and disk come from
/procandstatvfs. The numbers are the same onestopanddfwould show, which makes them easy to defend. - GPU metrics depend on the vendor. AMD cards are read from sysfs for busy percentage and VRAM use. NVIDIA cards go through
nvidia-smi. A host without a usable GPU reports nothing rather than a zero that looks healthy. - Docker state is read from the local socket: container name, state, and health, never logs or environment variables.
- systemd is queried read-only for unit state. The agent cannot start, stop, or restart anything.
- SMART drive health uses
smartctl -n standby, so a sleeping disk is skipped instead of spun up. SMART results are cached for ten minutes, because drive health does not change on a ten-second cadence.
The read-only rule is the important one. A monitoring agent that can mutate the host is a remote control with a nice UI, and I did not want that on the same box as the services.
Four states, not two
Binary up or down is not enough when a laptop sleeps, a tailnet link drops, or one collector fails while the rest of the host is fine. The dashboard makes a distinction between a host that is unreachable and data that is merely old.
| State | Meaning | What the card does |
|---|---|---|
| UP | The latest poll succeeded and every expected subsystem reported. | Shows live values and the time of the last check. |
| DEGRADED | The host answered, but a subsystem did not: an unhealthy container, a failed sensor read, a collector error. | Keeps the node visible and names the part that is unhappy instead of failing the whole card. |
| DOWN | Checks failed and the host is unreachable. | Marks the node down and keeps the last-seen time, so you know how long it has been gone. |
| STALE | The data on screen did not come from the latest poll. The node may be down, slow, or mid-recovery. | Retains the last successful payload and timestamps it as stale. Nothing is presented as current. |
STALE and DOWN are separate on purpose. A short blip should not wipe a card, and a card that has been showing the same numbers for two minutes should not look live. The timestamp is part of the state, not a tooltip.
Adaptive polling
A fixed interval is either too slow when a host recovers or too aggressive when it is dead. The poller changes cadence based on what it just saw, and the browser does the same while the page is open.
| Condition | Interval | Reason |
|---|---|---|
| Healthy | 10 s | Fast enough to feel live, cheap enough to run all day across the tailnet. |
| First 10 s after going STALE | 1 s | Catch a short drop before it turns into a visible outage. |
| DOWN, or STALE beyond 10 s | 15 s | Back off. A host that is gone does not need a request every second. |
| Browser, any node STALE | Fast poll | The open tab refreshes quickly so recovery appears without a manual reload. |
The 1-second window is bounded. If the host comes back inside it, the card returns to UP almost immediately. If it does not, the poller settles into the slower retry and stops spending requests on a problem that is not resolving. That one detail is the difference between a dashboard that feels responsive and one that hammers a sleeping laptop.
Bounded collection
Each collection pass runs at most eight checks concurrently and caches results for ten seconds. Both limits solve the same problem: a slow host must not delay the others, and two open browser tabs must not double the work on every agent.
Checks are independent, so one unreachable host times out without holding the pass open. The cache sits in front of the pool, which means a manual refresh or a second tab reads the same result instead of starting a new round of requests.
Tests that cannot touch the hardware
There are two test suites, one in Python and one in Node. Both run against mocked collectors, and the test process blocks sockets and subprocesses. A test cannot reach a real host, start a container, or call smartctl even if it tries.
That constraint forced the collectors and the state machine apart, which made the interesting behavior testable: healthy to stale, stale back to up, stale to down after the retry window, a single failed collector producing DEGRADED instead of DOWN, and a cached response surviving two collection passes. The tests assert the payload shape too, so an agent change that drops a field fails before the UI renders a blank bar.
What it does not do
- It does not store history. That is Prometheus's job, and duplicating it would make the agent heavier for no benefit.
- It does not page anyone. Alertmanager owns that path so a dashboard outage cannot silence an alert.
- It does not manage containers or services. Every action goes through Cockpit, SSH, or the service's own tooling.
- It does not try to be multi-user. One operator, one trusted network, one view.
The next changes are unglamorous: per-check timeouts tuned from real tailnet latency, a documented auth path for anyone who wants to run it somewhere less trusted, and a small history buffer for the bars so a spike is visible without opening Grafana.