Module: check_mk
Branch: master
Commit: 089f6a5d9390c58dd8894978067fc2b5a214a5d5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=089f6a5d9390c5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Feb 6 22:14:15 2016 +0100
#3167 FIX apc_inrow_airflow: fix exception in displaying parameters in WATO services list
Problem was due to mixup of integer and float.
---
.bugs/2353 | 7 +++++--
.werks/3167 | 9 +++++++++
ChangeLog | 1 +
checks/apc_inrow_airflow | 20 +++++++++++++-------
web/plugins/wato/check_parameters.py | 8 ++++----
5 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/.bugs/2353 b/.bugs/2353
index f3b1fac..6b77c06 100644
--- a/.bugs/2353
+++ b/.bugs/2353
@@ -1,12 +1,15 @@
Title: Error messages from discovery output of check parameters
Component: wato
-State: open
+Class: bug
+State: done
Date: 2015-09-11 21:21:42
Targetversion: 1.2.8
-Class: bug
If you perform a discovery and display the check parameters of the checks,
there will be displayed several messages with invalid check parameters.
This or similar messages will be showed: 85 is int but float is required
Noticed on APC devices.
+
+2016-02-06 22:13:21: changed state open -> done
+Fixed ValueSpec, converted default values to float.
diff --git a/.werks/3167 b/.werks/3167
new file mode 100644
index 0000000..cb33507
--- /dev/null
+++ b/.werks/3167
@@ -0,0 +1,9 @@
+Title: apc_inrow_airflow: fix exception in displaying parameters in WATO services list
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1454793206
+Class: fix
+
+Problem was due to mixup of integer and float.
diff --git a/ChangeLog b/ChangeLog
index a8191dc..68e6c7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -254,6 +254,7 @@
* 3069 FIX: unitrend_backup: fixed broken plugin output
* 2930 FIX: juniper_cpu_util: Better detection, find more devices...
* 3163 FIX: Treat interface name '1' and '01' as identical when
grouping interfaces...
+ * 3167 FIX: apc_inrow_airflow: fix exception in displaying parameters in WATO
services list...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/apc_inrow_airflow b/checks/apc_inrow_airflow
index 85ee8fd..755cd16 100644
--- a/checks/apc_inrow_airflow
+++ b/checks/apc_inrow_airflow
@@ -25,12 +25,17 @@
# Boston, MA 02110-1301 USA.
-apc_inrow_airflow_default_levels = { "level_low" : ( 5.0 , 2.0 ),
"level_high" : ( 10.0, 11.0 ) }
+apc_inrow_airflow_default_levels = {
+ "level_low" : ( 5.0 , 2.0 ),
+ "level_high" : ( 10.0, 11.0 ),
+}
+
def inventory_apc_inrow_airflow(info):
if info:
return [ (None, "apc_inrow_airflow_default_levels")]
+
def check_apc_inrow_airflow(_no_item, params, info):
flow = saveint(info[0][0])/100.0
state = 0
@@ -39,22 +44,23 @@ def check_apc_inrow_airflow(_no_item, params, info):
warn, crit = params['level_low']
if flow < crit:
state = 2
- message = "to low"
+ message = "too low"
elif flow < warn:
state = 1
- message = "to low"
+ message = "too low"
warn, crit = params['level_high']
- if flow > crit:
+ if flow >= crit:
state = 2
- message = "to high"
- elif flow > warn:
+ message = "too high"
+ elif flow >= warn:
state = 1
- message = "to high"
+ message = "too high"
perf = [ ("flow", flow, warn, crit ) ]
return state, "Current: %.2fl/s %s" % ( flow, message ), perf
+
check_info["apc_inrow_airflow"] = {
"check_function" : check_apc_inrow_airflow,
"inventory_function" : inventory_apc_inrow_airflow,
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 40b9fb3..842cfbe 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -8552,8 +8552,8 @@ register_check_parameters(
Tuple(
title = _("Lower levels"),
elements = [
- Integer(title = _( "Warning if below"), unit=_("l/s")),
- Integer(title = _( "Critical if below"), unit=_("l/s"))
+ Float(title = _("Warning if below"), unit=_("l/s"),
default_value = 5.0, allow_int=True),
+ Float(title = _("Critical if below"), unit=_("l/s"),
default_value = 2.0, allow_int=True)
]
)
),
@@ -8561,8 +8561,8 @@ register_check_parameters(
Tuple(
title = _("Upper levels"),
elements = [
- Integer(title = _( "Warning at"), unit=_("l/s")),
- Integer(title = _( "Critical at"), unit=_("l/s"))
+ Float(title = _("Warning at"), unit=_("l/s"),
default_value = 10.0, allow_int=True),
+ Float(title = _("Critical at"), unit=_("l/s"),
default_value = 11.0, allow_int=True)
]
)
),