Module: check_mk
Branch: master
Commit: 38e5e16be689bdd5acd34d74627098a5dbda6357
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=38e5e16be689bd…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 9 16:24:56 2017 +0200
4696 FIX mk_logwatch.exe in windows: now supports IPv6 addresses, fixed path of statefile
The mk_logwatch.exe crashed whenever an IPv6 host queried the system.
The logwatch statefile is now located in the state directory instead of the agent
directory.
Change-Id: I14e2ccd9401d1212438de80df14ca4234332bdce
---
.werks/4696 | 12 ++++++++++++
agents/plugins/mk_logwatch | 3 ++-
agents/windows/plugins/mk_logwatch.exe | Bin 4563948 -> 4555443 bytes
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/4696 b/.werks/4696
new file mode 100644
index 0000000..d78dc84
--- /dev/null
+++ b/.werks/4696
@@ -0,0 +1,12 @@
+Title: mk_logwatch.exe in windows: now supports IPv6 addresses, fixed path of statefile
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1494339798
+Class: fix
+
+The mk_logwatch.exe crashed whenever an IPv6 host queried the system.
+The logwatch statefile is now located in the state directory instead of the agent
directory.
+
diff --git a/agents/plugins/mk_logwatch b/agents/plugins/mk_logwatch
index 0da34a8..7ff4fb9 100755
--- a/agents/plugins/mk_logwatch
+++ b/agents/plugins/mk_logwatch
@@ -138,7 +138,7 @@ if logwatch_dir:
mk_vardir = logwatch_dir
else:
mk_confdir = os.getenv("MK_CONFDIR") or "."
- mk_vardir = os.getenv("MK_VARDIR") or "."
+ mk_vardir = os.getenv("MK_VARDIR") or os.getenv("MK_STATEDIR") or
"."
sys.stdout.write("<<<logwatch>>>\n")
@@ -152,6 +152,7 @@ config_dir = mk_confdir + "/logwatch.d/*.cfg"
# $REMOTE not set and a tty -> logwatch.state.local
# $REMOTE not set and not a tty -> logwatch.state
remote_hostname = os.getenv("REMOTE", "")
+remote_hostname = remote_hostname.replace(":", "_")
if remote_hostname != "":
status_filename = "%s/logwatch.state.%s" % (mk_vardir, remote_hostname)
else:
diff --git a/agents/windows/plugins/mk_logwatch.exe
b/agents/windows/plugins/mk_logwatch.exe
index 8d1119b..3407f7b 100755
Binary files a/agents/windows/plugins/mk_logwatch.exe and
b/agents/windows/plugins/mk_logwatch.exe differ