updates
This commit is contained in:
@@ -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'):
|
||||
|
||||
Reference in New Issue
Block a user