Module: check_mk
Branch: master
Commit: 24aa19310174c5c5598f4de98aa7b54c4931e1b9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=24aa19310174c5…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Feb 8 15:00:36 2017 +0100
4216 FIX cmciii.phase: Fix wrong scaling of power and energy values
Change-Id: Iea094fddeb3b16b3c9ce64593f2d95d4b20e3ea4
---
.werks/4216 | 9 +++++++++
ChangeLog | 1 +
checks/cmciii | 5 ++++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/4216 b/.werks/4216
new file mode 100644
index 0000000..cf61a7b
--- /dev/null
+++ b/.werks/4216
@@ -0,0 +1,9 @@
+Title: cmciii.phase: Fix wrong scaling of power and energy values
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1486562407
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 8499bcd..b3f4b79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -101,6 +101,7 @@
* 4341 FIX: cisco_wlc: fixed invalid parameters during service discovery
* 4024 FIX: netapp_api_volumes: fixed incorrect computation of read/write latency
* 4342 FIX: hp_proliant: fixed empty status handling
+ * 4216 FIX: cmciii.phase: Fix wrong scaling of power and energy values
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/cmciii b/checks/cmciii
index be43da1..2ef8ef6 100644
--- a/checks/cmciii
+++ b/checks/cmciii
@@ -162,9 +162,12 @@ def parse_cmciii(info):
elif int(scale) > 0:
scale_f = lambda a: float(a) * float(scale)
else:
- scale_f = lambda a: int(a)
+ scale_f = int
value = scale_f(value_int)
+ if "Power" in container or "Energy" in container:
+ value = value * 1000 # kW, kWh
+
if itemname in parsed[this_table] and \
parsed[this_table][itemname]["_location_"] != location:
itemname += " %s" % location