diff --git a/docs/alerts.md b/docs/alerts.md index 0896a25..f793931 100644 --- a/docs/alerts.md +++ b/docs/alerts.md @@ -58,6 +58,18 @@ fresh report. Run `sudo kernelwatch check-alerts` to check immediately, or inspe Upgrading starts the clock at the first check, so expect the first notifications a day after you re-run `install.sh`. +- **Livepatch alerts.** On Ubuntu hosts using + [Livepatch](how-it-works.md), a host whose live patching has been broken for + `livepatch_alert_after_hours` (default 6) gets one high-priority notification: + an unhealthy state (not `applied` or `nothing-to-apply`), a failed check, or an + unsupported kernel. It also fires when a host that *used to* report Livepatch + stops, which is what a dead Livepatch daemon looks like, since the agent then has + nothing to send. Hosts that have never reported Livepatch never alert. As with the + other alerts it's once per problem; getting healthy again re-arms it, and a brief + blip that clears within the period sends nothing. Stale hosts are skipped. A host + where you turn Livepatch off on purpose sends one message and then stays quiet. + `livepatch_alert_after_hours = 0` turns these off. + 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). diff --git a/docs/how-it-works.md b/docs/how-it-works.md index edbff1f..6b87b34 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -49,7 +49,8 @@ How the agent works it out: date, so cover ends 14 days before it and the host goes to `reboot` as usual. Any other reboot reason (libc, systemd) still counts. If Livepatch is failing, unsupported or in a state we don't know, the host gets no cover and the reason - is noted. Hosts without Livepatch are unaffected. `canonical-livepatch` needs + is noted, and after `livepatch_alert_after_hours` you get an + [ntfy alert](alerts.md). Hosts without Livepatch are unaffected. `canonical-livepatch` needs root and a snap cgroup, so like needrestart it runs in its own unit, `kernelwatch-livepatch.service`, which writes `/run/kernelwatch/livepatch` before each report. It's skipped when the snap isn't installed. diff --git a/server/server.toml.example b/server/server.toml.example index 872ba02..3819da2 100644 --- a/server/server.toml.example +++ b/server/server.toml.example @@ -51,6 +51,10 @@ ntfy_timeout_seconds = 10.0 # 0 disables. Needs ntfy_url. status_alert_after_hours = 24.0 +# Also notify (once per problem) when Ubuntu Livepatch has been unhealthy, or a host +# that used to report it has stopped, for this long. 0 disables. Needs ntfy_url. +livepatch_alert_after_hours = 6.0 + # Dead-man's switch: an external monitor (e.g. healthchecks.io) that alerts when the # pings STOP, which is how you learn kernelwatch itself isn't running. Treat these # URLs like passwords. Empty disables.