Module: check_mk
Branch: master
Commit: 554e56aa8233c4d547eaff7b80fddaede60e7629
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=554e56aa8233c4…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Nov 14 12:02:54 2014 +0100
#1438 FIX quicksearch: fixed various non-working quicksearch filters
Some of the view filters got renamed in the latest releases.
These changes were not considered in the quicksearch plugins which refer to these
filters.
As a result the hostgroup (<i>hg:</i>) search did not work properly.
Also the some multiple search filters (e.g. <i>h: test s: cpu hg:
testgroup</i>) did omit the
specified host- and servicegroup patterns.
---
.werks/1438 | 15 +++++++++++++++
ChangeLog | 1 +
web/htdocs/sidebar.py | 2 +-
web/plugins/sidebar/search.py | 16 ++++++++--------
4 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/.werks/1438 b/.werks/1438
new file mode 100644
index 0000000..090a7e5
--- /dev/null
+++ b/.werks/1438
@@ -0,0 +1,15 @@
+Title: quicksearch: fixed various non-working quicksearch filters
+Level: 2
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1415962691
+
+Some of the view filters got renamed in the latest releases.
+These changes were not considered in the quicksearch plugins which refer to these
filters.
+
+As a result the hostgroup (<i>hg:</i>) search did not work properly.
+Also the some multiple search filters (e.g. <i>h: test s: cpu hg:
testgroup</i>) did omit the
+specified host- and servicegroup patterns.
diff --git a/ChangeLog b/ChangeLog
index eebd7e1..0fe476a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -50,6 +50,7 @@
* 1494 FIX: Fixed error in NagVis Maps snapin when some users had no contact groups
assigned
* 1496 FIX: Fixed exception after editing a dashboard as user without permission to
publish dashboards...
* 1436 FIX: quicksearch: search with multiple patterns (h: / s:) no longer discards
the host pattern...
+ * 1438 FIX: quicksearch: fixed various non-working quicksearch filters...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 4f4e212..faf8b34 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -783,7 +783,7 @@ def search_url_tmpl(used_filters, row, exact = True):
if ty == 'hosts':
return
'view.py?view_name=searchhost&host_regex=%(name)s&filled_in=filter'
elif ty == 'hostgroups':
- return
'view.py?view_name=hostgroups&hostgroup_name=%(name)s&site=%(site)s'
+ return
'view.py?view_name=hostgroups&hostgroup_regex=%(name)s&site=%(site)s'
elif ty == 'servicegroups':
return
'view.py?view_name=svcgroups&servicegroup_name=%(name)s&site=%(site)s'
elif ty == 'services':
diff --git a/web/plugins/sidebar/search.py b/web/plugins/sidebar/search.py
index 9b7aae8..7494ab6 100644
--- a/web/plugins/sidebar/search.py
+++ b/web/plugins/sidebar/search.py
@@ -211,17 +211,17 @@ def search_host_service_filter(filters, host_is_ip = False):
def match_host_service_url_tmpl(used_filters, row_dict, host_is_ip = False):
tmpl = 'view.py?view_name=searchsvc&filled_in=filter'
- # Sorry, no support for multiple host- or servicegroups filters in match templates
+ # Sorry, no support for multiple host- or servicegroups filters in match templates
(yet)
for ty, entry in [ ("hostgroup", "host_groups"),
("servicegroup", "service_groups")]:
if row_dict.get(entry):
if type(row_dict[entry]) == list:
row_dict[entry] = row_dict[entry][0]
- for param, key in [ ("service_regex",
"service_description"),
- (host_is_ip and "host_address" or "host",
"host_name"),
- ("opthostgroup",
"host_groups"),
- ("optservicegroup",
"service_groups"),
- ("site", "site")]:
+ for param, key in [ ("service_regex",
"service_description"),
+ (host_is_ip and "host_address" or "host_regex",
"host_name"),
+ ("opthost_group",
"host_groups"),
+ ("optservice_group",
"service_groups"),
+ ("site",
"site")]:
if row_dict.get(key):
tmpl_pre = "&%s=%%(%s)s" % (param, key)
tmpl += tmpl_pre % row_dict
@@ -245,8 +245,8 @@ def search_host_service_url_tmpl(used_filters, data, host_is_ip =
False):
for url_param, qs_name in [ ("service_regex", "services"
),
host_is_ip and ("host_address", "host"
)\
or ("host_regex", "hosts"
),
- ("opthostgroup",
"hostgroups" ),
- ("optservicegroup",
"servicegroups")]:
+ ("opthost_group",
"hostgroups" ),
+ ("optservice_group",
"servicegroups")]:
if filters_combined.get(qs_name):
tmpl_pre = "&%s=%%(%s)s" % (url_param, qs_name)
tmpl += tmpl_pre % filters_combined