Module: check_mk
Branch: master
Commit: 6a6282abf89a75821fe091dbdebc72448016bef1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a6282abf89a75…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Nov 6 13:28:12 2013 +0100
Allow grouping by host, host group or service group
Within the availability reporting there is now a new option <i>Grouping</i>
for grouping by host, host group or service group. When grouping is enabled
then one separate table will be rendered for each host or group that is part
of the selected objects. For objects that are not part of any group (well, this
cannot happen if you group by host) one additional table is being rendered.
The host and service groups are sorted according to their internal ID, but
their aliasses are being displayed. That way you can defined your custom
order of the groups in the report - by wisely choosing the internal IDs.
<b>Note</b>: objects that are part of more than one group will appear in
more than one table.
---
.werks/55 | 5 +++++
web/plugins/views/availability.py | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/.werks/55 b/.werks/55
index 0cf0dc6..07c2545 100644
--- a/.werks/55
+++ b/.werks/55
@@ -11,5 +11,10 @@ then one separate table will be rendered for each host or group that is
part
of the selected objects. For objects that are not part of any group (well, this
cannot happen if you group by host) one additional table is being rendered.
+The host and service groups are sorted according to their internal ID, but
+their aliasses are being displayed. That way you can defined your custom
+order of the groups in the report - by wisely choosing the internal IDs.
+
<b>Note</b>: objects that are part of more than one group will appear in
more than one table.
+
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index 79b0e9f..c83cb23 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -990,7 +990,7 @@ def render_availability_table(availability, from_time, until_time,
range_title,
else:
title = group_titles.get(group_id, group_id)
titled_groups.append((title, group_id)) ## ACHTUNG
- titled_groups.sort()
+ titled_groups.sort(cmp = lambda a,b: cmp(a[1], b[1]))
# 3. Loop over all groups and render them
for title, group_id in titled_groups: