Flag hosts where unattended-upgrades has stopped succeeding

On a host with unattended-upgrades enabled, no successful run in
unattended_upgrades_stale_after_days (default 3, 0 disables) puts it in
update. The reason says which way it broke: still running but failing
("last succeeded 5d ago and is failing (last ran 6h ago); check
/var/log/unattended-upgrades/"), not running at all ("is
apt-daily-upgrade.timer enabled?"), or never succeeded. A host where it
hasn't completed its first run yet gets a note, and packages it keeps back
are noted. Hosts with it disabled or not installed, and agents before
0.8.0, are judged as before. The host page shows the state, both stamp
ages and the kept-back packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-10-31 20:18:41 -04:00
1 parent df097c9da3
commit bfac723850
7 files changed
+143

No files matched your search

+5
View File
@@ -37,6 +37,9 @@ class Config:
# (or Ubuntu standard support ends without ESM). 0 disables the warning; a host
# past the date is in update either way.
os_eol_warn_days: int = 90
# A host with unattended-upgrades enabled that hasn't had a successful run in this
# long is in update. It normally runs daily. 0 disables the check.
unattended_upgrades_stale_after_days: float = 3.0
# Where `scheduled-backup` (kernelwatch-backup.timer) writes dated copies of the
# database, and how many days of them it keeps; 0 keeps them all. It must stay
@@ -100,6 +103,8 @@ def load(path: str | None = None) -> Config:
raise SystemExit(f"{path}: ntfy_timeout_seconds must be positive and finite")
if cfg.report_min_interval_seconds < 0:
raise SystemExit(f"{path}: report_min_interval_seconds must be zero or positive")
if not math.isfinite(cfg.unattended_upgrades_stale_after_days) or cfg.unattended_upgrades_stale_after_days < 0:
raise SystemExit(f"{path}: unattended_upgrades_stale_after_days must be zero or positive and finite")
if cfg.os_eol_warn_days < 0:
raise SystemExit(f"{path}: os_eol_warn_days must be zero or positive")
if cfg.boot_min_free_mb < 0: