sitescope a small health monitor and status page for a few hosts

Use

Without NixOS

One static binary and one systemd user unit. A hub on Fedora or another distribution, watching its own host in-process plus the devices around it; or a hub on FreeBSD or OpenBSD.

The NixOS module is the main way to deploy sitescope, but the binary is static and needs nothing from the distribution. This page sets up a hub as an ordinary user’s systemd unit. It watches its own host without a separate agent process, plus devices on the network.

The binary

Starting with 1.6.0, releases include static binaries; earlier releases are tags only. Download the tarball for your system (linux-amd64 or linux-arm64; from 1.7.0 also freebsd-amd64 and openbsd-amd64) and check it against the release’s SHA256SUMS:

v=1.6.0
curl -fLO https://github.com/toppk/sitescope/releases/download/v$v/sitescope-$v-linux-amd64.tar.gz
curl -fLO https://github.com/toppk/sitescope/releases/download/v$v/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS
tar xzf sitescope-$v-linux-amd64.tar.gz
./sitescope-$v-linux-amd64/sitescope version     # 1.6.0+<short commit>

Or build it: nix build github:toppk/sitescope/v1.6.0, then use result/bin/sitescope.

Copy the binary somewhere that doesn’t change underneath the running unit, e.g. one directory per release with a current symlink.

The local host

A [[host]] with local = true is collected by the hub itself, in-process, instead of polled over HTTP. It needs no agent, port or token. The checks are the same as for a polled host, with the same ids, so the host can move to a separate agent later by replacing local = true with a url.

Configuration

~/sitescope/etc/config.toml:

[hub]
listen = "127.0.0.1:8470"
stateDir = "/home/me/sitescope/state"
controlSocket = "/run/user/1000/sitescope/control.sock"
publicURL = "https://status.home.example"
lockedAfter = "off"

[alerts]
enabled = true
from = "sitescope@home.example"
to = ["me@home.example"]
smtp = "127.0.0.1:25"
ntfy = { enabled = true }

[[host]]
name = "server"
local = true
os = "fedora"
wireguard = false
skip = ["swap"]
disks."/data" = { free = { warn = 500, crit = 100 } }
units = [
  { name = "backup.timer", user = true, maxAge = "26h" },
  { name = "fwupd-refresh.timer", severity = "warn" },
]

[ping]
targets = [
  { name = "printer.lan" },
  { name = "frame.lan", seenWithin = "6h" },
]

[tcp]
targets = [{ name = "camera.lan", port = 554 }]

[ipp]
targets = [{ name = "printer", url = "ipp://printer.lan/ipp/print" }]
{
  "hub": {
    "listen": "127.0.0.1:8470",
    "stateDir": "/home/me/sitescope/state",
    "controlSocket": "/run/user/1000/sitescope/control.sock",
    "publicURL": "https://status.home.example",
    "lockedAfter": "off"
  },
  "alerts": {
    "enabled": true,
    "from": "sitescope@home.example",
    "to": ["me@home.example"],
    "smtp": "127.0.0.1:25",
    "ntfy": {"enabled": true}
  },
  "host": [
    {
      "name": "server",
      "local": true,
      "os": "fedora",
      "wireguard": false,
      "skip": ["swap"],
      "disks": {
        "/data": {
          "free": {"warn": 500, "crit": 100}
        }
      },
      "units": [
        {"name": "backup.timer", "user": true, "maxAge": "26h"},
        {"name": "fwupd-refresh.timer", "severity": "warn"}
      ]
    }
  ],
  "ping": {
    "targets": [
      {"name": "printer.lan"},
      {"name": "frame.lan", "seenWithin": "6h"}
    ]
  },
  "tcp": {
    "targets": [{"name": "camera.lan", "port": 554}]
  },
  "ipp": {
    "targets": [{"name": "printer", "url": "ipp://printer.lan/ipp/print"}]
  }
}

Check it before starting the unit: sitescope config -config ~/sitescope/etc/config.toml -check.

The unit

# ~/.config/systemd/user/sitescope.service
[Unit]
Description=sitescope hub

[Service]
ExecStart=%h/sitescope/current/sitescope hub -config %h/sitescope/etc/config.toml
EnvironmentFile=%h/sitescope/etc/env
RuntimeDirectory=sitescope
Restart=on-failure
NoNewPrivileges=yes

[Install]
WantedBy=default.target

The environment file is mode 0600 and holds SITESCOPE_HEARTBEAT_URL and SITESCOPE_NTFY_URL. Run loginctl enable-linger for the user, so the unit starts at boot without a login. Then:

systemctl --user enable --now sitescope
sitescope verify -url http://127.0.0.1:8470 -version X.Y.Z+<short commit>

Put a reverse proxy with TLS in front of listen to serve the page beyond loopback.

On FreeBSD and OpenBSD

The hub, the CLI and, from 1.7.1, the agent run on FreeBSD and OpenBSD: the vault, the control socket, the status page, every network check, and the host checks. Tested on FreeBSD 15.1 and OpenBSD 8.0, with the agent and hub as an ordinary user.