Module: check_mk
Branch: master
Commit: 1a8bb18371e4a8b4272dbc86cc991431dda323af
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1a8bb18371e4a8…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed May 9 12:19:49 2018 +0200
6072 FIX humidity.include: Allow levels which are zero
Change-Id: Ic86478cf72c254074823089164136a3789bd0fa7
---
.werks/6072 | 10 ++++++++++
checks/humidity.include | 12 ++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/.werks/6072 b/.werks/6072
new file mode 100644
index 0000000..85ef654
--- /dev/null
+++ b/.werks/6072
@@ -0,0 +1,10 @@
+Title: humidity.include: Allow levels which are zero
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1525861120
+Class: fix
+
+
diff --git a/checks/humidity.include b/checks/humidity.include
index f9ae72a..a911a4f 100644
--- a/checks/humidity.include
+++ b/checks/humidity.include
@@ -43,30 +43,30 @@ def check_humidity(humidity, params):
perfdata = [ ("humidity", humidity, warn_upper, crit_upper, 0, 100) ]
infotext = get_percent_human_readable(humidity)
- if warn_lower and crit_lower:
+ if warn_lower is not None and crit_lower is not None:
levelstext_lower = " (warn/crit below %s/%s)" % (
get_percent_human_readable(warn_lower),
get_percent_human_readable(crit_lower))
- if warn_upper and crit_upper:
+ if warn_upper is not None and crit_upper is not None:
levelstext_upper = " (warn/crit at %s/%s)" % (
get_percent_human_readable(warn_upper),
get_percent_human_readable(crit_upper))
status = 0
levelstext = ""
- if crit_lower and humidity < crit_lower:
+ if crit_lower is not None and humidity < crit_lower:
status = 2
levelstext = levelstext_lower
- elif crit_upper and humidity >= crit_upper:
+ elif crit_upper is not None and humidity >= crit_upper:
status = 2
levelstext = levelstext_upper
- elif warn_lower and humidity < warn_lower:
+ elif warn_lower is not None and humidity < warn_lower:
status = 1
levelstext = levelstext_lower
- elif warn_upper and humidity >= warn_upper:
+ elif warn_upper is not None and humidity >= warn_upper:
status = 1
levelstext = levelstext_upper