Host monitoring: VictoriaMetrics + VictoriaLogs, per-site replicated hubs (flakes-f2ju)
Monitor the always-on hosts (initially pc @ site 102 and edger @ site 401): host health, systemd unit state, and service logs, with a web UI and an API/MCP surface for agents.
Decisions (2026-10-07)
- Stack: VictoriaMetrics + VictoriaLogs. Chosen over Beszel (no logs), Netdata (heavier, modern UI unfree/cloud-leaning) and Grafana+Prometheus+Loki (heaviest). Both have NixOS modules in our nixpkgs (
services.victoriametrics,services.victorialogsv1.49). - Topology: one hub per site, replicated (dual-write). pc is the hub for 102, edger for 401. Every monitored host runs agents that write to all hubs, so each hub holds the full dataset:
- per-site autonomy when the zerotier link is down;
- agents buffer to disk per remote URL and replay on reconnect (no gaps);
- any hub answers queries for every host (UI/API/MCP can point at either).
- Rejected: query-time federation (store once, fan-out via vmselect/vlselect or multi-datasource) — more moving parts, cross-site view lost when link down, only pays off at scale.
- Access: zerotier only. No cloudflared exposure. zerotier (172.22.0.0/16) is already in the firewalld
trustedzone (packs/nixos/host/zerotier/zerotierone.nix); bind on 0.0.0.0 or zerotier IP, do not open inlan/public zones unless needed. - Grafana: later, optional — start with built-in vmui (VM) and the VictoriaLogs web UI (
/select/vmui).
Data flow
each host
node_exporter (systemd collector) ──scrape── vmagent ──remoteWrite──▶ VM @ pc, VM @ edger
systemd-journal-upload ──▶ vlagent (local, /insert/journald) ──remoteWrite──▶ VL @ pc, VL @ edger
hub (pc, edger)
victoriametrics :8428 (vmui at /vmui)
victorialogs :9428 (UI at /select/vmui)
MCP server(s) for agents
Verified facts
vlagentreusesvlinsert.RequestHandler, so it accepts/insert/journald/directly (source: VictoriaLogs v1.49app/vlagent/main.go,app/vlinsert/main.go).-remoteWrite.urlis repeatable with per-URL disk queues.- nixpkgs
victorialogsbuilds vlagent only withwithVlAgent = trueoverride; there is no NixOS module for vlagent → custom systemd unit. - nixpkgs
services.vmagenthas a singleremoteWrite.url; extra URLs viaextraArgs. services.journald.uploadexists (systemd-journal-upload, single URL → point at local vlagent).mcp-grafanais packaged; the officialmcp-victoriametrics/mcp-victorialogsare not — need packaging.
Children
See child beans for: shared monitoring module, hub, metrics agent, log shipping, MCP, and Grafana follow-up.