Module: check_mk
Branch: master
Commit: 2162c79cd61d00609c1fda297b519e8f519fa2e0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2162c79cd61d00…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 5 16:55:02 2013 +0100
New rule for configuring the display_name of a service
Thew new rule set <i>Alternative display name for Services</i> allows you
to specify an alternative name to be displayed for certain services. It sets
the configuration parameter <tt>display_name</tt>. This name is available as
a column when creating new views or modifying existing ones. It is always
visible in the details view of a service. In the availability reporting there
is an option for using that name instead of the normal service description. It
does not automatically replace the normal service name in all views.
<b>Note</b>: The purpose of this rule set is to define unique names for
several
well-known services. It cannot rename services in general.
---
.werks/53 | 17 +++++++++++++++++
ChangeLog | 3 +++
web/plugins/views/builtin.py | 2 ++
web/plugins/views/filters.py | 2 ++
web/plugins/views/painters.py | 8 ++++++++
web/plugins/views/sorters.py | 1 +
web/plugins/wato/check_mk_configuration.py | 18 ++++++++++++++++++
7 files changed, 51 insertions(+)
diff --git a/.werks/53 b/.werks/53
new file mode 100644
index 0000000..0e32d55
--- /dev/null
+++ b/.werks/53
@@ -0,0 +1,17 @@
+Title: New rule for configuring the display_name of a service
+Level: 2
+Component: wato
+Version: 1.2.3i7
+Date: 1383666760
+Class: feature
+
+Thew new rule set <i>Alternative display name for Services</i> allows you
+to specify an alternative name to be displayed for certain services. It sets
+the configuration parameter <tt>display_name</tt>. This name is available as
+a column when creating new views or modifying existing ones. It is always
+visible in the details view of a service. In the availability reporting there
+is an option for using that name instead of the normal service description. It
+does not automatically replace the normal service name in all views.
+
+<b>Note</b>: The purpose of this rule set is to define unique names for
several
+well-known services. It cannot rename services in general.
diff --git a/ChangeLog b/ChangeLog
index c559e8a..0920db1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@
* 0044 FIX: LDAP: Fixed error with empty groups during non nested group sync...
* 0045 FIX: LDAP: Fixed error when synchronizing non nested groups to roles...
+ WATO:
+ * 0053: New rule for configuring the display_name of a service...
+
Reporting & Availability:
* 0051: Option for showing timeline directly in availability table...
* 0052: Visual colorization of availability according to levels...
diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py
index b43da9e..f9e7f7c 100644
--- a/web/plugins/views/builtin.py
+++ b/web/plugins/views/builtin.py
@@ -1219,6 +1219,7 @@ multisite_builtin_views.update({
'service_active_checks_enabled',
'summary_host',
'serviceregex',
+ 'service_display_name',
'check_command',
'hoststate',
'svcstate',
@@ -1284,6 +1285,7 @@ multisite_builtin_views.update({
('svc_in_downtime', None),
('svc_in_notifper', None),
('svc_notifper', None),
+ ('service_display_name', None),
('check_manpage', None),
('svc_custom_notes', None),
('svc_pnpgraph', None),
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 735edbd..66a93b9 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -68,6 +68,8 @@ declare_filter(200, FilterText("serviceregex",
_("Service"), "service",
declare_filter(201, FilterText("service", _("Service (exact match)"),
"service", "service_description", "service",
"="),
_("Exact match, used for linking"))
+declare_filter(202, FilterText("service_display_name", _("Service
alternative display name"), "service", "service_display_name",
"service_display_name", "~~"),
+ _("Alternative display name of the service, regex
match"))
declare_filter(101, FilterText("hostgroupnameregex",
_("Hostgroup)"), "hostgroup", "hostgroup_name",
"hostgroup_name", "~~"),
_("Search field allowing regular expressions and
partial matches on the names of hostgroups"))
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 67c20e2..d4e8889 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -482,6 +482,14 @@ multisite_painters["service_description"] = {
"sorter" : 'svcdescr',
}
+multisite_painters["service_display_name"] = {
+ "title" : _("Service alternative dislay name"),
+ "short" : _("Display name"),
+ "columns" : ["service_display_name"],
+ "paint" : lambda row: (None, row["service_display_name"]),
+ "sorter" : 'svcdispname',
+}
+
multisite_painters["svc_state_age"] = {
"title" : _("The age of the current service state"),
"short" : _("Age"),
diff --git a/web/plugins/views/sorters.py b/web/plugins/views/sorters.py
index 51fde64..c5d2419 100644
--- a/web/plugins/views/sorters.py
+++ b/web/plugins/views/sorters.py
@@ -128,6 +128,7 @@ multisite_sorters["host"] = {
# name title column
sortfunction
declare_simple_sorter("svcdescr", _("Service
description"), "service_description", cmp_simple_string)
+declare_simple_sorter("svcdispname", _("Service alternative
display name"), "service_display_name", cmp_simple_string)
declare_simple_sorter("svcoutput", _("Service plugin
output"), "service_plugin_output", cmp_simple_string)
declare_simple_sorter("svc_long_plugin_output", _("Long output of check
plugin"), "service_long_plugin_output", cmp_simple_string)
declare_simple_sorter("site", _("Site"),
"site", cmp_simple_string)
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 7738b4f..b17bf65 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1724,6 +1724,24 @@ register_rule(group,
),
)
+register_rule(group,
+ "extra_service_conf:display_name",
+ TextUnicode(
+ title = _("Alternative display name for Services"),
+ help = _("This rule set allows you to specify an alternative name "
+ "to be displayed for certain services. This name is available as
"
+ "a column when creating new views or modifying existing ones.
"
+ "It is always visible in the details view of a service. In the
"
+ "availability reporting there is an option for using that name
"
+ "instead of the normal service description. It does
<b>not</b> automatically "
+ "replace the normal service name in all
views.<br><br><b>Note</b>: The "
+ "purpose of this rule set is to define unique names for several
well-known "
+ "services. It cannot rename services in general."),
+ size = 64,
+ ),
+ itemtype = "service")
+
+
group = "monconf/" + _("Inventory and Check_MK settings")
register_rule(group,