Module: check_mk
Branch: master
Commit: 87c2cb3606963143e7c7f80085be296aafabf2d5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=87c2cb36069631…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 11 21:57:22 2012 +0100
Icon to events of host links to view that has context button to host
---
ChangeLog | 1 +
mkeventd/web/plugins/icons/mkeventd.py | 6 ++++-
mkeventd/web/plugins/views/mkeventd.py | 38 ++++++++++++++++++++++++++++++++
3 files changed, 44 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ddbf7d4..e76326d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -63,6 +63,7 @@
via a new button in WATO.
* Speedup access to event history by earlier filtering and prefiltering with grep
* New builtin syslog server! Please refer to online docu for details.
+ * Icon to events of host links to view that has context button to host
1.2.1i3:
Core:
diff --git a/mkeventd/web/plugins/icons/mkeventd.py
b/mkeventd/web/plugins/icons/mkeventd.py
index 9487d6b..62501df 100644
--- a/mkeventd/web/plugins/icons/mkeventd.py
+++ b/mkeventd/web/plugins/icons/mkeventd.py
@@ -79,7 +79,11 @@ def paint_mkeventd(what, row, tags, custom_vars):
url_prefix = site['url_prefix'] + 'check_mk/'
title = _('Events of Host %s') % (host)
- url = 'view.py?view_name=ec_events_of_host&event_host=' + host
+ url = 'view.py?' + htmllib.urlencode_vars([
+ ("view_name", "ec_events_of_monhost"),
+ ("site", row["site"]),
+ ("host", host),
+ ])
if len(args) >= 2:
app = args[1].strip('\'')
diff --git a/mkeventd/web/plugins/views/mkeventd.py
b/mkeventd/web/plugins/views/mkeventd.py
index 766ce55..8dc44ee 100644
--- a/mkeventd/web/plugins/views/mkeventd.py
+++ b/mkeventd/web/plugins/views/mkeventd.py
@@ -828,6 +828,44 @@ if mkeventd_enabled:
],
})
+ multisite_builtin_views['ec_events_of_monhost'] = mkeventd_view({
+ 'title': u'Events of Monitored Host',
+ 'description': u'Currently open events of a host that is
monitored',
+ 'datasource': 'mkeventd_events',
+ 'layout': 'table',
+ 'hidden': True,
+ 'painters': [
+ ('event_id', 'ec_event', ''),
+ ('event_icons', None, ''),
+ ('event_state', None, ''),
+ ('event_sl', None, ''),
+ ('event_rule_id', None, ''),
+ ('event_application', None, ''),
+ ('event_text', None, ''),
+ ('event_last', None, ''),
+ ('event_count', None, ''),
+ ],
+ 'show_filters': [
+ 'event_id',
+ 'event_rule_id',
+ 'event_text',
+ 'event_application',
+ 'event_contact',
+ 'event_comment',
+ 'event_count',
+ 'event_phase',
+ 'event_state',
+ 'event_first',
+ 'event_last',
+ 'event_priority',
+ 'event_facility',
+ 'event_sl',
+ ],
+ 'hide_filters': [
+ 'site',
+ 'host',
+ ],
+ })
multisite_builtin_views['ec_events_of_host'] = mkeventd_view({
'title': u'Events of Host',
'description': u'Currently open events of one specific host',