Module: check_mk
Branch: master
Commit: c5b568fdd835bdc53d860e055d4f3e6cea6e0908
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c5b568fdd835bd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 24 13:02:29 2014 +0100
FIX Allow overriding of active checks by more specific rule
If you define an active Check via WATO in the main folder and then
want to override this check in a subfolder, that was not possible
up to now. Now if you define an active check <b>with the same
type and service description</b> by a more specific rule, then
that rule will override the more general ones (i.e. those
coming later).
---
.werks/682 | 14 ++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 6 ++++++
3 files changed, 21 insertions(+)
diff --git a/.werks/682 b/.werks/682
new file mode 100644
index 0000000..0da43bb
--- /dev/null
+++ b/.werks/682
@@ -0,0 +1,14 @@
+Title: Allow overriding of active checks by more specific rule
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1390564829
+
+If you define an active Check via WATO in the main folder and then
+want to override this check in a subfolder, that was not possible
+up to now. Now if you define an active check <b>with the same
+type and service description</b> by a more specific rule, then
+that rule will override the more general ones (i.e. those
+coming later).
diff --git a/ChangeLog b/ChangeLog
index 51c3ffd..8bea274 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
* 0259 FIX: Fixed htpasswd permission problem in check_mk standalone installation...
* 0453 FIX: Fix ugly Python exception in host diagnosis page in case of SNMP
error...
* 0696 FIX: Remove garbled output of cmk -v in state of CMC
+ * 0682 FIX: Allow overriding of active checks by more specific rule...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 2d64184..107c83d 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2289,6 +2289,12 @@ define service {
if description in used_descriptions:
cn, it = used_descriptions[description]
+ # If we have the same active check again with the same description,
+ # then we do not regard this as an error, but simply ignore the
+ # second one. That way one can override a check with other settings.
+ if cn == "active(%s)" % acttype:
+ continue
+
raise MKGeneralException(
"ERROR: Duplicate service description (active check)
'%s' for host '%s'!\n"
" - 1st occurrance: checktype = %s, item = %r\n"