Module: check_mk
Branch: master
Commit: b8cf042bafe40e6bb8d831609b79ffd774ec2a06
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8cf042bafe40e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 6 10:33:52 2017 +0200
4949 FIX Fixed grouping by host-/servicegroup in availability views
Change-Id: Ice1f538e511c9d55dc62c3947db71bae4d39729e
---
.werks/4949 | 11 +++++++++++
web/htdocs/availability.py | 7 ++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/4949 b/.werks/4949
new file mode 100644
index 0000000..d1f47b9
--- /dev/null
+++ b/.werks/4949
@@ -0,0 +1,11 @@
+Title: Fixed grouping by host-/servicegroup in availability views
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1499329958
+
+
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index 05932c8..243c0d9 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -703,6 +703,9 @@ def filter_groups_of_entries(context, avoptions, spans):
# They need to be able to filter the list of all groups.
# TODO: Negated filters are not handled here. :(
if group_by == "service_groups":
+ if "servicegroups" not in context and "optservicegroup" not
in context:
+ return
+
# Extract from context:
# 'servicegroups': {'servicegroups': 'cpu|disk',
'neg_servicegroups': 'off'},
# 'optservicegroup': {'optservice_group': '',
'neg_optservice_group': 'off'},
@@ -721,7 +724,9 @@ def filter_groups_of_entries(context, avoptions, spans):
only_groups.add(group_name)
elif group_by == "host_groups":
- html.log(repr(context))
+ if "hostgroups" not in context and "opthostgroup" not in
context:
+ return
+
negated = context.get("hostgroups", {}).get("neg_hostgroups")
== "on"
if negated:
return