Module: check_mk
Branch: master
Commit: 4c742891eb0d74a10e3cf29bd81864fb0051d8c6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4c742891eb0d74…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Tue May 15 11:24:46 2018 +0200
Minor refactoring of paint_logwatch
Change-Id: Ic46e8012c3c32c95212d551d1fedd80996dce630
---
web/plugins/icons/builtin.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/web/plugins/icons/builtin.py b/web/plugins/icons/builtin.py
index c7ab694..b68883c 100644
--- a/web/plugins/icons/builtin.py
+++ b/web/plugins/icons/builtin.py
@@ -449,14 +449,13 @@ multisite_icons_and_actions['custom_action'] = {
# | |
# '----------------------------------------------------------------------'
-def logwatch_url(sitename, hostname, item):
- return html.makeuri_contextless([("site", sitename), ("host",
hostname), ("file", item)], filename="logwatch.py")
-
def paint_logwatch(what, row, tags, host_custom_vars):
- if what != "service":
+ if what != "service" or row[what + "_check_command"] not in
['check_mk-logwatch', 'check_mk-logwatch.groups']:
return
- if row[what + "_check_command"] in [ 'check_mk-logwatch',
'check_mk-logwatch.groups' ]:
- return 'logwatch', _('Open Log'),
logwatch_url(row["site"], row['host_name'],
row['service_description'][4:])
+
+ sitename, hostname, item = row['site'], row['host_name'],
row['service_description'][4:]
+ url = html.makeuri_contextless([("site", sitename), ("host",
hostname), ("file", item)], filename="logwatch.py")
+ return 'logwatch', _('Open Log'), url
multisite_icons_and_actions['logwatch'] = {
'service_columns': [ 'host_name', 'service_description',
'check_command' ],