diff --git a/README.md b/README.md index 7659cd3..e447408 100644 --- a/README.md +++ b/README.md @@ -369,7 +369,7 @@ Host zeus ProxyJump eurus ``` -## Stale-host and recovery alerts (ntfy) +## Stale-host, reboot and update alerts (ntfy) The server can notify an [ntfy](https://ntfy.sh/) topic when a host stops reporting and when its reports resume. Agents report hourly with up to 15 minutes @@ -413,6 +413,16 @@ fresh report. Run `sudo kernelwatch check-alerts` to check immediately, or inspe `stale_after_hours`, restart `kernelwatch.service` too so the dashboard uses the new threshold. +- **Reboot and update alerts.** A host that has stayed in `reboot` or `update` + for `status_alert_after_hours` (default 24) gets one notification listing the + reasons shown on the dashboard. The clock starts when the host entered that + status, so hourly reports don't restart it. Fixing the host (back to `ok`) + re-arms it. Going from `update` to `reboot` notifies again after another + period; going back down doesn't. Stale hosts are skipped, since the stale + alert covers them. Set `status_alert_after_hours = 0` to turn these off. + Upgrading starts the clock at the first check, so expect the first + notifications a day after you re-run `install.sh`. + Use the topic's direct publish URL, with token authentication if needed; it must accept the POST without a browser login or redirect. The topic and token stay in the server config (root-owned, readable by the `kernelwatch` service group). @@ -428,7 +438,7 @@ sudo kernelwatch list-hosts hosts and when they last reported sudo kernelwatch set-password USER create a user / change password (logs out their sessions) sudo kernelwatch remove-user USER sudo kernelwatch list-users -sudo kernelwatch check-alerts check for stale hosts and reporting recovery now +sudo kernelwatch check-alerts check for stale, recovered, reboot and update alerts now sudo kernelwatch test-alert send a test notification to the configured ntfy topic ``` @@ -483,7 +493,7 @@ export KERNELWATCH_CONFIG=/tmp/kw.toml ## Ideas for later -- Notifications for pending updates/reboots, and additional delivery channels +- Additional notification channels - Ubuntu Livepatch / Pro status, so live-patched hosts aren't flagged for reboot - A JSON endpoint for scripting - Grouping or tagging hosts (prod/staging, location) diff --git a/server/server.toml.example b/server/server.toml.example index c10f052..b7e1fbb 100644 --- a/server/server.toml.example +++ b/server/server.toml.example @@ -31,3 +31,9 @@ trust_proxy_headers = false ntfy_url = "" # e.g. "https://ntfy.example.com/kernelwatch" ntfy_token = "" # optional ntfy access token (Bearer auth) ntfy_timeout_seconds = 10.0 + +# Also notify (once) when a host has needed a reboot or updates for this long. +# Measured from when the host entered that state, not from its latest report. +# Reaching a worse state (updates -> reboot) notifies again after another period. +# 0 disables. Needs ntfy_url. +status_alert_after_hours = 24.0