Module: check_mk
Branch: master
Commit: 7e417ce41ec0bc40b17cb3c2250160f1f37039c0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7e417ce41ec0bc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 9 11:47:55 2018 +0100
5595 FIX Fixed "Events of monitored host" view showing events not related to the
wanted host
Change-Id: I3fa90451ebe35f36c71301a611ed8d5035fcc186
---
.werks/5595 | 11 +++++++++++
web/htdocs/views.py | 5 ++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/5595 b/.werks/5595
new file mode 100644
index 0000000..7af4590
--- /dev/null
+++ b/.werks/5595
@@ -0,0 +1,11 @@
+Title: Fixed "Events of monitored host" view showing events not related to the
wanted host
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i3
+Date: 1515494847
+
+
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 4ec808f..659f07d 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1510,10 +1510,13 @@ def show_view(view, show_heading = False, show_buttons = True,
# events is always empty since the single context filter "host" is sending
a "host_name = ..."
# filter to livestatus which is not matching a "unrelated event". Instead
the filter event_host
# needs to be used.
+ # But this may only be done for the unrelated events view. The
"ec_events_of_monhost" view still
+ # needs the filter. :-/
# Another idea: We could change these views to non single context views, but then we
would not
# be able to show the buttons to other host related views, which is also bad. So
better stick
# with the current mode.
- if view["datasource"] in [ "mkeventd_events",
"mkeventd_history" ] and "host" in view["single_infos"]:
+ if view["datasource"] in [ "mkeventd_events",
"mkeventd_history" ] \
+ and "host" in view["single_infos"] and view["name"]
!= "ec_events_of_monhost":
# Remove the original host name filter
use_filters = [ f for f in use_filters if f.name != "host" ]