Module: check_mk
Branch: master
Commit: 0e2b992af576926996e939905090b22e4f2993f7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e2b992af57692…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Sep 22 14:34:19 2015 +0200
icons: handle shadow services and hosts
---
.bugs/2379 | 10 ++++++++++
web/plugins/icons/builtin.py | 12 ++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/.bugs/2379 b/.bugs/2379
new file mode 100644
index 0000000..07218e5
--- /dev/null
+++ b/.bugs/2379
@@ -0,0 +1,10 @@
+Title: Drop action menu icon for services without an entry in this
+Component: multisite
+State: open
+Date: 2015-09-22 09:53:11
+Targetversion: future
+Class: bug
+
+In certain circumstances the dropdown menu for a host or service can be
+completely empty (e.g. when using cmcdump). Drop this menu completely in
+that case.
diff --git a/web/plugins/icons/builtin.py b/web/plugins/icons/builtin.py
index 86e22ce..afe42f1 100644
--- a/web/plugins/icons/builtin.py
+++ b/web/plugins/icons/builtin.py
@@ -136,6 +136,9 @@ def paint_reschedule(what, row, tags, host_custom_vars):
return "cannot_reschedule", _("This service is based on cached
agent data and cannot be rescheduled"), None
# Reschedule button
+ if row[what + "_check_type"] == 2:
+ return # shadow hosts/services cannot be rescheduled
+
if (row[what + "_active_checks_enabled"] == 1
or row[what + '_check_command'].startswith('check_mk-')) \
and config.may('action.reschedule'):
@@ -160,7 +163,7 @@ def paint_reschedule(what, row, tags, host_custom_vars):
return icon, txt, url
multisite_icons_and_actions['reschedule'] = {
- 'columns': [ 'active_checks_enabled', 'check_command'
],
+ 'columns': [ 'check_type', 'active_checks_enabled',
'check_command' ],
'service_columns': [ 'cached_at' ],
'paint': paint_reschedule,
'toplevel': False,
@@ -179,6 +182,9 @@ multisite_icons_and_actions['reschedule'] = {
# '----------------------------------------------------------------------'
def paint_rule_editor(what, row, tags, host_custom_vars):
+ if row[what + "_check_type"] == 2:
+ return # shadow services have no parameters
+
if config.wato_enabled and config.may("wato.rulesets") and
config.multisite_draw_ruleicon:
urlvars = [("mode", "object_parameters"),
("host", row["host_name"])]
@@ -192,7 +198,7 @@ def paint_rule_editor(what, row, tags, host_custom_vars):
return 'rulesets', title, html.makeuri_contextless(urlvars,
"wato.py")
multisite_icons_and_actions['rule_editor'] = {
- 'service_columns': [ 'description', 'check_command',
"host_name" ],
+ 'service_columns': [ 'check_type', 'description',
'check_command', "host_name" ],
'paint': paint_rule_editor,
}
@@ -813,3 +819,5 @@ multisite_icons_and_actions['crashed_check'] = {
'paint' : paint_icon_crashed_check,
'toplevel' : True,
}
+
+#.