Module: check_mk
Branch: master
Commit: 838aa818f56604781b84451e93ac686f22967200
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=838aa818f56604…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jun 28 09:32:54 2017 +0200
4918 FIX EC views: Hiding wrong icons for events that are not related to a host
This issue was introduced with 1.4.0p6.
Change-Id: Iac2278c9ea1e6b43092eb644b7043c7d80477891
---
.werks/4918 | 11 +++++++++++
web/plugins/views/mkeventd.py | 1 +
web/plugins/views/painters.py | 6 +++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/4918 b/.werks/4918
new file mode 100644
index 0000000..aefe1a5
--- /dev/null
+++ b/.werks/4918
@@ -0,0 +1,11 @@
+Title: EC views: Hiding wrong icons for events that are not related to a host
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498635111
+
+This issue was introduced with 1.4.0p6.
diff --git a/web/plugins/views/mkeventd.py b/web/plugins/views/mkeventd.py
index 7e598e3..b5ea5c9 100644
--- a/web/plugins/views/mkeventd.py
+++ b/web/plugins/views/mkeventd.py
@@ -68,6 +68,7 @@ def query_ec_table(datasource, columns, add_columns, query, only_sites,
limit, t
for row in rows:
if not row.get("host_name"):
row["host_name"] = row["event_host"]
+ row["event_is_unrelated"] = True
return rows
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index ed52745..057c434 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -397,8 +397,12 @@ def replace_action_url_macros(url, what, row):
# what: either "host" or "service"
# row: the data row of the host or service
def paint_icons(what, row):
- if not row["host_name"]:
+ # EC: In case of unrelated events also skip rendering this painter. All the icons
+ # that display a host state are useless in this case. Maybe we make this decision
+ # individually for the single icons one day.
+ if not row["host_name"] or row.get("event_is_unrelated"):
return "", ""# Host probably does not exist
+
toplevel_icons = get_icons(what, row, toplevel=True)
# In case of non HTML output, just return the top level icon names