Files
homelab-monitor/docs/hot-reload.md
T
jhodgkin 1e1fb98afb
CI / web (push) Successful in 16s
CI / api (push) Successful in 22s
Hot-reload sshHosts/knownDevices from hosts.yaml, no restart needed
Checks the file's mtime on each poll cycle (already running every
30s) rather than adding a separate file-watcher or admin UI. Proxmox
hosts already needed no config (auto-discovered every poll); this
covers the two lists that did. A parse failure logs and keeps the
previous config running instead of crashing the poller.

Closes #14.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-12 21:36:37 -06:00

1.1 KiB

Editing monitored hosts without a redeploy

config/hosts.yaml's sshHosts and knownDevices lists are re-read on the next poll cycle (checks the file's mtime, reloads if changed) — no container restart needed.

  • Proxmox-monitored hosts (the node + every LXC) need no config at all — they're auto-discovered from the Proxmox API on every poll already.
  • SSH-monitored hosts (sshHosts): edit config/hosts.yaml on the deploy host directly (/opt/homelab-monitor/config/hosts.yaml on CT122), save, wait up to one poll interval (POLL_INTERVAL_SECONDS, default 30s). Adding a new SSH host still needs a one-time manual step first — installing the forced-command key on the target (see docs/ssh-collector-key-setup.md) — that part can't be automated away, so a web form wouldn't make this fully self-service regardless of hot-reload.
  • knownDevices (device discovery labeling): same file, same reload path, no manual step needed since it's just a label list.

If the file fails to parse (bad YAML), the error is logged and the previous in-memory config keeps running rather than crashing the poller.