Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/check_systemd_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down