From aebb1e0f46bffb8ecde33bd9d33580026ce469b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrkan=20G=C3=BCr?= Date: Thu, 16 Oct 2025 09:00:18 +0200 Subject: [PATCH] check_systemd_units: Ignore non-actionable scope failures --- src/check_systemd_units.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/check_systemd_units.py b/src/check_systemd_units.py index 32956135..ee180f6e 100755 --- a/src/check_systemd_units.py +++ b/src/check_systemd_units.py @@ -282,7 +282,13 @@ def check_unit(self, unit_id: str, timer: bool = False) -> CheckResult: ) ) - # Fast state checks first + # First, ignore transient session and user scope units: not actionable + harmless + if unit_id.endswith('.scope'): + if unit_id.startswith('session-') or unit_id.startswith('user@'): + logger.debug(f'Ignoring transient scope unit {unit_id}') + return CheckResult(Codes.OK, '') + + # Fast state checks if unit['LoadState'] != 'loaded' and unit['ActiveState'] != 'inactive': return CheckResult( Codes.CRITICAL,