Module: check_mk
Branch: master
Commit: 7366490c3d58f3d9f2d64f62f60ffc896c01f045
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7366490c3d58f3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jun 25 09:53:20 2014 +0200
FIX logwatch.ec: Fix forwarding multiple messages via syslog/TCP
If you setup forwarding to the Event Console in the {logwatch.ec} check to
be done via TCP and more than one new message per check interval arrived,
then several messages could have be joined together into one single message.
The reason was a missing newline character. This has been fixed. Forwarding
via UDP was not affected by this bug.
---
.werks/989 | 13 +++++++++++++
ChangeLog | 1 +
checks/logwatch | 2 +-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/989 b/.werks/989
new file mode 100644
index 0000000..f79bba0
--- /dev/null
+++ b/.werks/989
@@ -0,0 +1,13 @@
+Title: logwatch.ec: Fix forwarding multiple messages via syslog/TCP
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i5
+Date: 1403682696
+
+If you setup forwarding to the Event Console in the {logwatch.ec} check to
+be done via TCP and more than one new message per check interval arrived,
+then several messages could have be joined together into one single message.
+The reason was a missing newline character. This has been fixed. Forwarding
+via UDP was not affected by this bug.
diff --git a/ChangeLog b/ChangeLog
index 5fb7d96..0aa1bfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.2.5i5:
Checks & Agents:
* 0994 FIX: agent plugin smart: fixed syntax error
+ * 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
Livestatus:
* 0988 FIX: livedump: Fix exception in case no contact groups are defined for a
service
diff --git a/checks/logwatch b/checks/logwatch
index b238f32..99394e6 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -530,7 +530,7 @@ def check_logwatch_ec(item, params, info):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((method[1], method[2]))
for message in messages:
- sock.send(message)
+ sock.send(message + "\n")
sock.close()
elif not method.startswith('spool:'):