Module: check_mk
Branch: master
Commit: a3304115f1c479b91f1378711be06bf5e601e0cd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a3304115f1c479…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 24 14:29:25 2014 +0100
Update of Werk 682: Overriding of custom checks
---
.werks/682 | 15 +++++++--------
ChangeLog | 2 +-
modules/check_mk.py | 5 +++++
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/.werks/682 b/.werks/682
index 0da43bb..9a0407d 100644
--- a/.werks/682
+++ b/.werks/682
@@ -1,14 +1,13 @@
-Title: Allow overriding of active checks by more specific rule
+Title: Allow overriding of active and custom checks by more specific rule
Level: 1
Component: core
-Class: fix
State: unknown
Version: 1.2.5i1
Date: 1390564829
+Class: fix
-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).
+If you define an active or custom 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 f07eef7..6da324c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,7 +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...
+ * 0682 FIX: Allow overriding of active and custom 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 107c83d..20bb90b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2356,6 +2356,11 @@ 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.
+ if cn == "custom(%s)" % command_name:
+ continue
raise MKGeneralException(
"ERROR: Duplicate service description (custom check)
'%s' for host '%s'!\n"
" - 1st occurrance: checktype = %s, item = %r\n"