Module: check_mk
Branch: master
Commit: 18b7ee1c824147417b1853da43efbfe0e42602a6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=18b7ee1c824147…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Apr 8 09:30:11 2016 +0200
3393 FIX Availability annotations: also show annotations for hosts when showing services
---
.werks/3393 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/views/availability.py | 5 ++++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/3393 b/.werks/3393
new file mode 100644
index 0000000..c254306
--- /dev/null
+++ b/.werks/3393
@@ -0,0 +1,10 @@
+Title: Availability annotations: also show annotations for hosts when showing services
+Level: 1
+Component: reporting
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1460100559
+
+
diff --git a/ChangeLog b/ChangeLog
index 464a98c..e71a681 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -261,6 +261,7 @@
* 3269 FIX: Fix rendering of floating point values < 1 in graphs (e.g. CPU load)
* 3331 FIX: Availability: avoid duplication of annotation when changing time while
editing
* 3332 FIX: Avoid falling back to annotation edit form when reloading page directly
after editing
+ * 3393 FIX: Availability annotations: also show annotations for hosts when showing
services
Event Console:
* 2999 The contact name is now included in Event Console notifications...
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index 9da5b5e..cac4e53 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -597,7 +597,10 @@ def render_annotations(annotations, by_host, what, avoptions,
omit_service):
for site_host, avail_entries in by_host.iteritems():
for service in avail_entries.keys():
site_host_svc = site_host[0], site_host[1], (service or None)
- for annotation in annotations.get(site_host_svc, []):
+ annotations_to_check = annotations.get(site_host_svc, [])
+ if what == "service": # Also show host annotations for services
+ annotations_to_check += annotations.get((site_host[0], site_host[1],
None), [])
+ for annotation in annotations_to_check:
if (annotation["from"] >= from_time and
annotation["from"] <= until_time) or \
(annotation["until"] >= from_time and
annotation["until"] <= until_time):
annos_to_render.append((site_host_svc, annotation))