diff --git a/src/check_systemd_units.py b/src/check_systemd_units.py index 3295613..ee180f6 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,