Module: check_mk
Branch: master
Commit: 8c26a2a8dd7f15d1d4037769ce2868f338b710ac
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8c26a2a8dd7f15…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 18 13:45:16 2013 -0500
FIX: use default values for unset variables in actions
---
.bugs/1073 | 7 +++----
.bugs/1076 | 6 ++++--
ChangeLog | 1 +
mkeventd/bin/mkeventd | 11 +++++++++--
4 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/.bugs/1073 b/.bugs/1073
index 2852c1d..281a051 100644
--- a/.bugs/1073
+++ b/.bugs/1073
@@ -5,7 +5,6 @@ Date: 2013-10-15 23:42:57
Targetversion: 1.2.3i3
Class: bug
-The online help sometimes randomly switches on on Chrome.
-Never seen this on Firefox. Seem like the help.mk in the
-user profile correctly corresponds to the settings, so
-there it is no javascript problem?
+The online help sometimes randomly switches on on Chrome on Windows.
+Never seen this on Firefox. Seems like the help.mk in the user profile
+correctly corresponds to the settings, so there it is no javascript problem?
diff --git a/.bugs/1076 b/.bugs/1076
index 8434893..b045584 100644
--- a/.bugs/1076
+++ b/.bugs/1076
@@ -1,11 +1,13 @@
Title: $COUNT$ empty in non-counting rule
Component: ec
-State: open
+Class: bug
+State: done
Date: 2013-10-16 23:17:16
Targetversion: 1.4.0
-Class: bug
If you use the placeholder $COUNT$ in actions or emails and have no counting
rule, then the macro is not being replaced. Would should make a better macro
replacement, that is not based on the actual fields of an event but on the
declared fields, and apply default values for any missing field.
+
+2013-10-18 13:45:05: changed state open -> done
diff --git a/ChangeLog b/ChangeLog
index afc198b..b03421f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
Event Console:
* check_mkevents now available as C binary: check_mkevents_c
+ * FIX: use default values for unset variables in actions
Multisite:
* Speed-O-Meter: now measure only service checks. Host checks
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index e4065d0..97df06a 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -2687,8 +2687,15 @@ def do_rule_action(action, event, user=""):
log("Error during execution of action %s: %s" %
(action["id"], format_exception()))
def substitute_event_tags(text, event):
- groups = [("match_group_%d" % (nr+1), g) for (nr, g) in
enumerate(event.get("match_groups", ()))]
- for key, value in event.items() + groups:
+ substs = [("match_group_%d" % (nr+1), g)
+ for (nr, g)
+ in enumerate(event.get("match_groups", ()))]
+
+ for key, defaultvalue in event_columns:
+ varname = key[6:]
+ substs.append((varname, event.get(varname, defaultvalue)))
+
+ for key, value in substs:
if type(value) == tuple:
value = " ".join(value)
elif type(value) not in [ str, unicode ]: