Module: check_mk
Branch: master
Commit: 410db589b5b6b47274e17a2a96944d289e89ae9c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=410db589b5b6b4…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Thu Apr 14 15:23:58 2016 +0200
3123 FIX fix for temperature services discovered pre-1.2.8 that caused errors on writing
configuration
---
.werks/3123 | 10 ++++++++++
ChangeLog | 1 +
modules/check_mk.py | 19 +++++++++++++++----
3 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/.werks/3123 b/.werks/3123
new file mode 100644
index 0000000..f8c7ed9
--- /dev/null
+++ b/.werks/3123
@@ -0,0 +1,10 @@
+Title: fix for temperature services discovered pre-1.2.8 that caused errors on writing
configuration
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1460640119
+
+
diff --git a/ChangeLog b/ChangeLog
index 941f55b..0fe2aed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
* 3105 FIX: fixed crash in cmk --dump for services containing non-ascii characters
* 3343 FIX: MKP: Verifying minimal version of packages during installation...
* 3349 FIX: Added rule to disable Inline-SNMP per host...
+ * 3123 FIX: fix for temperature services discovered pre-1.2.8 that caused errors on
writing configuration
Checks & Agents:
* 3183 aruba_wlc_aps: new check which monitors the provisioned accesspoints of an
Aruba Network WLAN Controller
diff --git a/modules/check_mk.py b/modules/check_mk.py
index fc5a7c5..6a7ecf6 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -299,6 +299,13 @@ old_service_descriptions = {
"raritan_pdu_inlet" : "Input Phase %s",
}
+# workaround: set of check-groups that are to be treated as service-checks even if
+# the item is None
+service_rule_groups = set([
+ "temperature"
+])
+
+
#.
# .--Modules-------------------------------------------------------------.
# | __ __ _ _ |
@@ -4886,10 +4893,14 @@ def get_checkgroup_parameters(host, checktype, item):
if rules == None:
return []
- if item == None: # checks without an item
- return host_extra_conf(host, rules)
- else: # checks with an item need service-specific rules
- return service_extra_conf(host, item, rules)
+ try:
+ # checks without an item
+ if item == None and checkgroup not in service_rule_groups:
+ return host_extra_conf(host, rules)
+ else: # checks with an item need service-specific rules
+ return service_extra_conf(host, item, rules)
+ except MKGeneralException, e:
+ raise MKGeneralException(str(e) + " (on host %s, checktype %s)" %
(host, checktype))
def output_profile():