Module: check_mk
Branch: master
Commit: dad4190d391bb41f7880aebca3d71d62a9f465b4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dad4190d391bb4…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Nov 9 10:09:48 2017 +0100
5354 FIX cmctc_lcp: Fixes an error leading to wrong inventory and check output
This werk fixes an error which caused that the inventory for some sensors
was not performed correctly. This resulted in a wrong amount of discovered
services and a wrong output (numbers and units) for these services .
Therefore, the services of the corresponding hosts have to be rediscovered.
Temperature sensors are not affected by this error. One other type of
sensor is not affected as well. Which sensor type it is might depend on the
used Python version. In tests using Python version 2.7.14 Blower sensors
were not affected.
Change-Id: I4c4d941006a2ea19acd42582359fd3f035b15a9c
---
.werks/5354 | 17 +++++++++++++++++
checks/cmctc_lcp | 34 ++++++++++++++++++++++++++--------
2 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/.werks/5354 b/.werks/5354
new file mode 100644
index 0000000..d52de1c
--- /dev/null
+++ b/.werks/5354
@@ -0,0 +1,17 @@
+Title: cmctc_lcp: Fixes an error leading to wrong inventory and check output
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.5.0i1
+Date: 1510217496
+Class: fix
+
+This werk fixes an error which caused that the inventory for some sensors
+was not performed correctly. This resulted in a wrong amount of discovered
+services and a wrong output (numbers and units) for these services .
+Therefore, the services of the corresponding hosts have to be rediscovered.
+Temperature sensors are not affected by this error. One other type of
+sensor is not affected as well. Which sensor type it is might depend on the
+used Python version. In tests using Python version 2.7.14 Blower sensors
+were not affected.
diff --git a/checks/cmctc_lcp b/checks/cmctc_lcp
index 0637aeb..a16d8f3 100644
--- a/checks/cmctc_lcp
+++ b/checks/cmctc_lcp
@@ -174,15 +174,33 @@ snmp_info["cmctc_lcp"] = (
]
)
+check_info['cmctc_lcp.blower'] = {
+ "check_function" : lambda item,params,info: check_cmctc_lcp(item,
params, info, 'blower'),
+ "inventory_function" : lambda info: inventory_cmctc_lcp(info,
'blower'),
+ "has_perfdata" : True,
+ "service_description" : "Blower %s",
+}
+
+check_info['cmctc_lcp.blowergrade'] = {
+ "check_function" : lambda item,params,info: check_cmctc_lcp(item,
params, info, 'blowergrade'),
+ "inventory_function" : lambda info: inventory_cmctc_lcp(info,
'blowergrade'),
+ "has_perfdata" : True,
+ "service_description" : "Blower Grade %s",
+}
-for _s, _i in cmctc_lcp_sensortypes.items():
- if _s != "temp":
- check_info['cmctc_lcp.' + _s] = {
- "check_function" : lambda item,params,info:
check_cmctc_lcp(item, params, info, _s),
- "inventory_function" : lambda info: inventory_cmctc_lcp(info,
_s),
- "has_perfdata" : True,
- "service_description" : _i[1] + " %s",
- }
+check_info['cmctc_lcp.flow'] = {
+ "check_function" : lambda item,params,info: check_cmctc_lcp(item,
params, info, 'flow'),
+ "inventory_function" : lambda info: inventory_cmctc_lcp(info,
'flow'),
+ "has_perfdata" : True,
+ "service_description" : "Waterflow %s",
+}
+
+check_info['cmctc_lcp.regulator'] = {
+ "check_function" : lambda item,params,info: check_cmctc_lcp(item,
params, info, 'regulator'),
+ "inventory_function" : lambda info: inventory_cmctc_lcp(info,
'regulator'),
+ "has_perfdata" : True,
+ "service_description" : "Regulator %s",
+}
# temperature check is standardised
check_info['cmctc_lcp.temp'] = {