Module: check_mk
Branch: master
Commit: 01e48f334dc349c03177f2ef8c159d6b91e9e076
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=01e48f334dc349…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 15 14:04:14 2015 +0100
Fixed Real-Time packets produced by the linux agent
---
agents/check_mk_agent.linux | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index c7f11e5..cc638ec 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -166,9 +166,11 @@ function run_real_time_checks()
# Be aware of maximum packet size. Maybe we need to check the size of the
section
# output and do some kind of nicer error handling.
# 2 bytes: protocol version, 10 bytes: timestamp, rest: encrypted data
- (echo -ne 00 ; date +%s | tr -d '\n' ;
- export RTC_SECRET=$RTC_SECRET ;
- section_$SECTION | openssl enc -aes-256-cbc -pass env:RTC_SECRET -nosalt)
>/dev/udp/$REMOTE/$RTC_PORT
+ # dd is used to concatenate the output of all commands to a single
write/block => udp packet
+ { echo -n 00 ;
+ date +%s | tr -d '\n' ;
+ export RTC_SECRET=$RTC_SECRET ; section_$SECTION | openssl enc -aes-256-cbc
-pass env:RTC_SECRET -nosalt ;
+ } | dd bs=9999 iflag=fullblock 2>/dev/null >/dev/udp/$REMOTE/$RTC_PORT
done
sleep 1