Module: check_mk
Branch: master
Commit: 5a67a618742930bf6b4663a649045963e1442cb2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5a67a618742930…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 8 21:48:19 2014 +0100
#1718 Show groups of regex match of events in details views of Event Console
---
.werks/1718 | 9 +++++++++
ChangeLog | 1 +
mkeventd/web/plugins/views/mkeventd.py | 19 +++++++++++++++++++
web/htdocs/status.css | 10 ++++++++++
4 files changed, 39 insertions(+)
diff --git a/.werks/1718 b/.werks/1718
new file mode 100644
index 0000000..5daef04
--- /dev/null
+++ b/.werks/1718
@@ -0,0 +1,9 @@
+Title: Show groups of regex match of events in details views of Event Console
+Level: 1
+Component: ec
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418071673
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 9286c23..59e40f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -252,6 +252,7 @@
Event Console:
* 1169 Added host state type filter to "recent event history" view
+ * 1718 Show groups of regex match of events in details views of Event Console
* 1531 FIX: Fixed exception in event history view when displaying CHANGESTATE events
* 1610 FIX: Hostname translation now also works for incoming SNMP traps
* 1643 FIX: Improved error handling of exceptions when processing log lines
diff --git a/mkeventd/web/plugins/views/mkeventd.py
b/mkeventd/web/plugins/views/mkeventd.py
index f30494e..d6643d3 100644
--- a/mkeventd/web/plugins/views/mkeventd.py
+++ b/mkeventd/web/plugins/views/mkeventd.py
@@ -334,6 +334,23 @@ if mkeventd_enabled:
"paint" : lambda row: ("",
row["event_text"].replace("\x01","<br>")),
}
+ def paint_ec_match_groups(row):
+ groups = row["event_match_groups"]
+ if groups:
+ code = ""
+ for text in groups:
+ code += '<span>%s</span>' % text
+ return "matchgroups", code
+ else:
+ return "", ""
+
+ multisite_painters["event_match_groups"] = {
+ "title" : _("Match Groups"),
+ "short" : _("Match"),
+ "columns" : ["event_match_groups"],
+ "paint" : paint_ec_match_groups,
+ }
+
multisite_painters["event_first"] = {
"title" : _("Time of first occurrance of this serial"),
"short" : _("First"),
@@ -906,6 +923,7 @@ if mkeventd_enabled:
('host_contacts', None, ''),
('host_icons', None, ''),
('event_text', None, ''),
+ ('event_match_groups', None, ''),
('event_comment', None, ''),
('event_owner', None, ''),
('event_first', None, ''),
@@ -1002,6 +1020,7 @@ if mkeventd_enabled:
('event_state', None, ''),
('event_host', 'ec_history_of_host', ''),
('event_text', None, ''),
+ ('event_match_groups', None, ''),
('event_comment', None, ''),
('event_owner', None, ''),
('event_first', None, ''),
diff --git a/web/htdocs/status.css b/web/htdocs/status.css
index 0631c30..4836d29 100644
--- a/web/htdocs/status.css
+++ b/web/htdocs/status.css
@@ -397,3 +397,13 @@ table.data tr.data td table.customvars td:last-child {
border-left: 1px solid #bbb;
padding-left: 5px;
}
+
+td.matchgroups span {
+ margin-right: 3px;
+ background-color: #ffffff;
+ border: 1px solid #eeeeee;
+ border-radius: 3px;
+ box-shadow: 0px 0px 1px #888;
+ padding: 0px 3px;
+ font-family: monospace;
+}