This commit is contained in:
Mark Gregory
2026-10-22 09:27:17 +01:00
parent ed5bf665b9
commit 0a6f6ac058
22 changed files with 791 additions and 68 deletions
+20 -1
View File
@@ -62,7 +62,26 @@ for directory in ('/', '/backup'):
systemctl = run(['systemctl', '--failed', '--no-legend', '--plain'])
if systemctl is not None:
failed = [line for line in systemctl.stdout.splitlines() if line.strip()]
check('Services', 'Failed systemd units', 'fail' if failed else 'ok',
# Firmware metadata refresh is noncritical.
# Any other failed systemd unit remains critical.
optional_units = {'fwupd-refresh.service'}
failed_names = [
line.split()[0].lstrip('●')
for line in failed
if line.split()
]
if not failed:
severity = 'ok'
elif failed_names and all(
unit in optional_units for unit in failed_names
):
severity = 'warn'
else:
severity = 'fail'
check('Services', 'Failed systemd units', severity,
', '.join(failed[:5]) if failed else 'None')
if shutil.which('docker'):