An unhealthy Livepatch state was only a note on the dashboard. This adds an ntfy
alert for it.
The alert check notifies once per problem, high priority, when:
Livepatch has been unhealthy for livepatch_alert_after_hours (default 6, 0
disables): a state other than applied/nothing-to-apply, a check that didn't
complete, or an unsupported kernel; or
a host that used to report Livepatch no longer does. A dead Livepatch daemon
makes canonical-livepatch status fail, the agent has nothing to send, and
that looks like a host that never had it. A new livepatch_alerts table records
which hosts have reported Livepatch (plus when the current problem began and
whether it was notified), so hosts without Livepatch never alert.
Behavior matches the other alerts: one message per episode, healthy again
re-arms it, a problem that clears within the period sends nothing, stale hosts
are skipped, failed deliveries retry, restarts don't repeat, and state is only
written when it changes.
livepatch_problem() is now the single definition of "unhealthy", shared with the
rule that decides whether a pending reboot is covered by Livepatch. It also names
the check state when that is the problem (it used to say "applied, supported" for
a failed check).
The table is CREATE TABLE IF NOT EXISTS, so no migration.
Testing
make test: 235 tests pass (16 new): grace boundary, one alert per episode, every
kind of unhealthy, healthy states never alert, blips forgiven, re-arming, a host
that stops reporting, hosts that never had Livepatch, stale skipped, retry after
a failed send, 0 disables, cascade on host removal, no needless writes, config
validation. Seven deliberate breakages (alert never-enrolled hosts, repeat,
ignore grace, never mark notified, don't skip stale, write every run, reset the
clock) each broke a test.
Not run: against a live host. To try it, set livepatch_alert_after_hours = 0.1
temporarily and stop the Livepatch daemon on a test host.
## Summary
An unhealthy Livepatch state was only a note on the dashboard. This adds an ntfy
alert for it.
The alert check notifies once per problem, high priority, when:
- Livepatch has been unhealthy for `livepatch_alert_after_hours` (default 6, `0`
disables): a state other than applied/nothing-to-apply, a check that didn't
complete, or an unsupported kernel; or
- a host that **used to report Livepatch no longer does**. A dead Livepatch daemon
makes `canonical-livepatch status` fail, the agent has nothing to send, and
that looks like a host that never had it. A new `livepatch_alerts` table records
which hosts have reported Livepatch (plus when the current problem began and
whether it was notified), so hosts without Livepatch never alert.
Behavior matches the other alerts: one message per episode, healthy again
re-arms it, a problem that clears within the period sends nothing, stale hosts
are skipped, failed deliveries retry, restarts don't repeat, and state is only
written when it changes.
`livepatch_problem()` is now the single definition of "unhealthy", shared with the
rule that decides whether a pending reboot is covered by Livepatch. It also names
the check state when that is the problem (it used to say "applied, supported" for
a failed check).
The table is `CREATE TABLE IF NOT EXISTS`, so no migration.
## Testing
`make test`: 235 tests pass (16 new): grace boundary, one alert per episode, every
kind of unhealthy, healthy states never alert, blips forgiven, re-arming, a host
that stops reporting, hosts that never had Livepatch, stale skipped, retry after
a failed send, `0` disables, cascade on host removal, no needless writes, config
validation. Seven deliberate breakages (alert never-enrolled hosts, repeat,
ignore grace, never mark notified, don't skip stale, write every run, reset the
clock) each broke a test.
Not run: against a live host. To try it, set `livepatch_alert_after_hours = 0.1`
temporarily and stop the Livepatch daemon on a test host.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
patrick
added 2 commits 2026-10-30 16:19:53 +00:00
The alert check now also notifies, once per problem, when a host's Livepatch has
been unhealthy for livepatch_alert_after_hours (default 6), or when a host that
used to report Livepatch no longer does (a dead daemon leaves the agent with
nothing to send). A livepatch_alerts table records which hosts have reported
Livepatch, when the current problem began and whether it was notified, so hosts
without Livepatch never alert and restarts do not repeat messages. Stale hosts
are skipped.
livepatch_problem() is now the single test for unhealthy, shared with the cover
rule for pending reboots, and names the check state when that is the problem.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
An unhealthy Livepatch state was only a note on the dashboard. This adds an ntfy
alert for it.
The alert check notifies once per problem, high priority, when:
livepatch_alert_after_hours(default 6,0disables): a state other than applied/nothing-to-apply, a check that didn't
complete, or an unsupported kernel; or
makes
canonical-livepatch statusfail, the agent has nothing to send, andthat looks like a host that never had it. A new
livepatch_alertstable recordswhich hosts have reported Livepatch (plus when the current problem began and
whether it was notified), so hosts without Livepatch never alert.
Behavior matches the other alerts: one message per episode, healthy again
re-arms it, a problem that clears within the period sends nothing, stale hosts
are skipped, failed deliveries retry, restarts don't repeat, and state is only
written when it changes.
livepatch_problem()is now the single definition of "unhealthy", shared with therule that decides whether a pending reboot is covered by Livepatch. It also names
the check state when that is the problem (it used to say "applied, supported" for
a failed check).
The table is
CREATE TABLE IF NOT EXISTS, so no migration.Testing
make test: 235 tests pass (16 new): grace boundary, one alert per episode, everykind of unhealthy, healthy states never alert, blips forgiven, re-arming, a host
that stops reporting, hosts that never had Livepatch, stale skipped, retry after
a failed send,
0disables, cascade on host removal, no needless writes, configvalidation. Seven deliberate breakages (alert never-enrolled hosts, repeat,
ignore grace, never mark notified, don't skip stale, write every run, reset the
clock) each broke a test.
Not run: against a live host. To try it, set
livepatch_alert_after_hours = 0.1temporarily and stop the Livepatch daemon on a test host.
🤖 Generated with Claude Code