Module: check_mk
Branch: master
Commit: 2ae178516853b9f2b94e6d7adab56b957decfcc4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ae178516853b9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu May 12 08:50:27 2016 +0200
Fixed acknowledging mk_logwatch logfiles on remote hosts
---
web/htdocs/logwatch.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/web/htdocs/logwatch.py b/web/htdocs/logwatch.py
index 822620d..cec2ff0 100644
--- a/web/htdocs/logwatch.py
+++ b/web/htdocs/logwatch.py
@@ -307,21 +307,25 @@ def do_log_ack(site, host_name, file_name):
for this_site, this_host, int_filename, display_name in logs_to_ack:
try:
acknowledge_logfile(this_site, this_host, int_filename, display_name)
- html.message('<b>%s</b><p>%s</p>' % (
- _('Acknowledged %s') % ack_msg,
- _('Acknowledged all messages in %s.') % ack_msg
- ))
except Exception, e:
html.show_error(_('The log file <tt>%s</tt> of host
<tt>%s</tt> could not be deleted: %s.') % \
(html.attrencode(display_name),
html.attrencode(this_host), e))
+ htmt.footer()
+ return
+ html.message('<b>%s</b><p>%s</p>' % (
+ _('Acknowledged %s') % ack_msg,
+ _('Acknowledged all messages in %s.') % ack_msg
+ ))
html.footer()
def acknowledge_logfile(site, host_name, int_filename, display_name):
if not may_see(site, host_name):
raise MKAuthException(_('Permission denied.'))
- os.remove(defaults.logwatch_dir + '/' + host_name + '/' +
int_filename)
+
+ command = "MK_LOGWATCH_ACKNOWLEDGE;%s;%s" % (host_name, int_filename)
+ sites.live().command("[%d] %s" % (int(time.time()), command), site)
#.