Module: check_mk
Branch: master
Commit: ad0aacd5af32f856ebe01f898f0b8f81cf198711
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ad0aacd5af32f8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 31 14:40:45 2013 +0100
FIX Fix rule precedence in WATO-configured manual checks
When configuring rules for <i>Manual Checks</i> via WATO and
having several rules for the same combination of host, check type
and item, then the <i>last</i> of these rules would specify the
parameters of the check. This has now been fixed and the <i>first</i>
matching rule has precedence.
---
.werks/401 | 14 ++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 14 +++++++++++++-
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/.werks/401 b/.werks/401
new file mode 100644
index 0000000..957b4a6
--- /dev/null
+++ b/.werks/401
@@ -0,0 +1,14 @@
+Title: Fix rule precedence in WATO-configured manual checks
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1388497148
+Targetversion: future
+
+When configuring rules for <i>Manual Checks</i> via WATO and
+having several rules for the same combination of host, check type
+and item, then the <i>last</i> of these rules would specify the
+parameters of the check. This has now been fixed and the <i>first</i>
+matching rule has precedence.
diff --git a/ChangeLog b/ChangeLog
index 567a1aa..bea7e32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
* 0379 FIX: check_mk -c: Now also rewrites the location of conf.d directory
* 0354 FIX: Catch exception when check plugins do not return a state...
* 0398 FIX: Tolerate debug output in check plugins when using CMC...
+ * 0401 FIX: Fix rule precedence in WATO-configured manual checks...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 1b723b5..b0dd374 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -5341,9 +5341,21 @@ def read_config_files(with_autochecks=True, with_conf_d=True):
params[key] = value
static.append((taglist, hostlist, checktype, item, params))
+
+ # Note: We need to reverse the order of the static_checks. This is because
+ # users assume that earlier rules have precedence over later ones. For static
+ # checks that is important if there are two rules for a host with the same
+ # combination of check type and item. When the variable 'checks' is evaluated,
+ # *later* rules have precedence. This is not consistent with the rest, but a
+ # result of this "historic implementation".
+ static.reverse()
+
+ # Now prepend to checks. That makes that checks variable have precedence
+ # over WATO.
checks = static + checks
- # Read autochecks and append them to explicit checks
+ # Read autochecks and prepend them to explicit checks. That way autochecks
+ # will have the *least* precedence!
if with_autochecks:
read_all_autochecks()
checks = autochecks + checks
Module: check_mk
Branch: master
Commit: 9641bb4346df6a341f15570b778b01e91ee11348
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9641bb4346df6a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 31 14:50:54 2013 +0100
FIX Fix exception in case of missing agent sections of cluster-aware checks
If you configure (by mistake) an <tt>ps</tt> check on an SNMP device - which
obviously does not have that agent information - Check_MK would crash with
an exception. This has been fixed.
---
.werks/402 | 12 ++++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/402 b/.werks/402
new file mode 100644
index 0000000..b6fe3f4
--- /dev/null
+++ b/.werks/402
@@ -0,0 +1,12 @@
+Title: Fix exception in case of missing agent sections of cluster-aware checks
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1388497781
+Targetversion: future
+
+If you configure (by mistake) an <tt>ps</tt> check on an SNMP device - which
+obviously does not have that agent information - Check_MK would crash with
+an exception. This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index bea7e32..cb41fac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
* 0354 FIX: Catch exception when check plugins do not return a state...
* 0398 FIX: Tolerate debug output in check plugins when using CMC...
* 0401 FIX: Fix rule precedence in WATO-configured manual checks...
+ * 0402 FIX: Fix exception in case of missing agent sections of cluster-aware checks...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index bab5a00..2c8f358 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -306,7 +306,7 @@ def get_host_info(hostname, ipaddress, checkname):
return info
else:
info = get_realhost_info(hostname, ipaddress, checkname, check_max_cachefile_age)
- if add_nodeinfo:
+ if info != None and add_nodeinfo:
return [ [ None ] + line for line in info ]
else:
return info