MKP 2.2.0 released, bugfixes for rules with no levels set

This commit is contained in:
2026-03-09 16:06:42 +00:00
parent 027a303af1
commit 74e20a8e8e
5 changed files with 33 additions and 26 deletions

View File

@@ -20,6 +20,9 @@ def get_state_upper(
levels: tuple[int | float, int | float], value: int | float
) -> State:
"""returns OK/WARN/CRIT depending on the given parameters"""
if levels is None:
# a rule with no levels set is active, assume OK state
return State.OK
warn, crit = levels
if value >= crit:
return State.CRIT