Skip to content

Commit aebb1e0

Browse files
committed
check_systemd_units: Ignore non-actionable scope failures
1 parent 75d9e7e commit aebb1e0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/check_systemd_units.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,13 @@ def check_unit(self, unit_id: str, timer: bool = False) -> CheckResult:
282282
)
283283
)
284284

285-
# Fast state checks first
285+
# First, ignore transient session and user scope units: not actionable + harmless
286+
if unit_id.endswith('.scope'):
287+
if unit_id.startswith('session-') or unit_id.startswith('user@'):
288+
logger.debug(f'Ignoring transient scope unit {unit_id}')
289+
return CheckResult(Codes.OK, '')
290+
291+
# Fast state checks
286292
if unit['LoadState'] != 'loaded' and unit['ActiveState'] != 'inactive':
287293
return CheckResult(
288294
Codes.CRITICAL,

0 commit comments

Comments
 (0)