Module: check_mk
Branch: master
Commit: fb8bc1fa0af86cd0530dcade878f769a4dad8b2e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fb8bc1fa0af86c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 29 10:22:07 2017 +0200
4922 FIX Logwatch: Show only hosts with problematic log files in "Problematic log
file" list
Change-Id: I8d34a96cff04e433e5dbbd51e89be2fb9ac0e317
---
.werks/4922 | 11 +++++++++++
web/htdocs/logwatch.py | 7 +++++++
2 files changed, 18 insertions(+)
diff --git a/.werks/4922 b/.werks/4922
new file mode 100644
index 0000000..ff21528
--- /dev/null
+++ b/.werks/4922
@@ -0,0 +1,11 @@
+Title: Logwatch: Show only hosts with problematic log files in "Problematic log
file" list
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498724504
+
+
diff --git a/web/htdocs/logwatch.py b/web/htdocs/logwatch.py
index 06ffe7b..7a2f301 100644
--- a/web/htdocs/logwatch.py
+++ b/web/htdocs/logwatch.py
@@ -86,6 +86,13 @@ def show_log_list():
for site, host_name, logs in all_logs():
if not logs:
continue
+
+ all_logs_empty = not any([ parse_file(site, host_name, file_name)
+ for file_name in logs ])
+
+ if all_logs_empty:
+ continue # Logfile vanished
+
html.h2(html.render_a(host_name, href=html.makeuri([('site', site),
('host', host_name)])))
list_logs(site, host_name, logs)
html.footer()