Module: check_mk
Branch: master
Commit: 62535a69db66f3effe6d9065f08b23cbcb64d3ae
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=62535a69db66f3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Aug 16 11:51:31 2011 +0200
Multisite: filters for host and service contact groups
---
ChangeLog | 1 +
web/plugins/views/builtin.py | 3 +++
web/plugins/views/filters.py | 16 +++++++++-------
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0554719..189746b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,6 +83,7 @@
with a dict of "dirty" hosts
* Added column painter for host contacts
* Added column painters for contact groups, added those to detail views
+ * Added filters for host and service contact groups
* Detail views of host/service now show contacts
* Fix playing of sounds: All problem views now have play_sounds activated,
all other deactivated.
diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py
index 7c2b86c..5471c0a 100644
--- a/web/plugins/views/builtin.py
+++ b/web/plugins/views/builtin.py
@@ -940,6 +940,7 @@ multisite_builtin_views.update({
'hostregex',
'summary_host',
'opthostgroup',
+ 'opthost_contactgroup',
'host_check_command',
],
'sorters': [],
@@ -994,6 +995,7 @@ multisite_builtin_views.update({
'public': True,
'show_filters': ['service_in_notification_period',
'optservicegroup',
+ 'optservice_contactgroup',
'service_notifications_enabled',
'host_in_notification_period',
'in_downtime',
@@ -1006,6 +1008,7 @@ multisite_builtin_views.update({
'check_command',
'svcstate',
'opthostgroup',
+ 'opthost_contactgroup',
'output',
'service_is_flapping',
'svc_last_state_change',
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 0d8e939..cbcf3c3 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -90,14 +90,14 @@ class FilterGroupCombo(Filter):
if not enforce:
htmlvars.append("neg_" + htmlvars[0])
Filter.__init__(self, self.prefix + what + "group", # name, e.g.
"hostgroup"
- what[0].upper() + what[1:] + "group", # title, e.g.
"Hostgroup"
- what, # info, e.g.
"host"
+ what[0].upper() + what[1:].replace("_"," ") + "
group", # title, e.g. "Hostgroup"
+ what.split("_")[0], # info, e.g.
"host"
htmlvars, # htmlvars, e.g.
"hostgroup"
[ what + "group_name" ]) # rows needed to
fetch for link information
self.what = what
def display(self):
- choices = all_groups(self.what)
+ choices = all_groups(self.what.split("_")[-1])
if not self.enforce:
choices = [("", "")] + choices
html.select(self.htmlvars[0], choices)
@@ -150,10 +150,12 @@ class FilterGroupCombo(Filter):
return alias
-declare_filter(104, FilterGroupCombo("host", True), _("Dropdown list,
selection of host group is <b>enforced</b>"))
-declare_filter(204, FilterGroupCombo("service", True), _("Dropdown list,
selection of service group is <b>enforced</b>"))
-declare_filter(105, FilterGroupCombo("host", False), _("Optional
selection of host group"))
-declare_filter(205, FilterGroupCombo("service", False), _("Optional
selection of service group"))
+declare_filter(104, FilterGroupCombo("host", True),
_("Dropdown list, selection of host group is <b>enforced</b>"))
+declare_filter(204, FilterGroupCombo("service", True),
_("Dropdown list, selection of service group is <b>enforced</b>"))
+declare_filter(105, FilterGroupCombo("host", False),
_("Optional selection of host group"))
+declare_filter(205, FilterGroupCombo("service", False),
_("Optional selection of service group"))
+declare_filter(106, FilterGroupCombo("host_contact", False),
_("Optional selection of host contact group group"))
+declare_filter(206, FilterGroupCombo("service_contact", False),
_("Optional selection of service contact group group"))
# Livestatus still misses "contact_groups" column.
# declare_filter(FilterGroupCombo("contact"))