Module: check_mk
Branch: master
Commit: bfa61fdfd43148ae4755451ee8cdea4f8e5b84f0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bfa61fdfd43148…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Sep 27 09:02:04 2018 +0200
6731 FIX check_mk_agent.aix: Fixed multiline output processing
When running MRPE scripts which provide multilines
a service was created for each line. This led to
pointless services.
Change-Id: I611cc0a877b92c34eb4ea716d31965046b96d945
---
.werks/6731 | 13 +++++++++++++
agents/check_mk_agent.aix | 5 +++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/6731 b/.werks/6731
new file mode 100644
index 0000000..3bf9bca
--- /dev/null
+++ b/.werks/6731
@@ -0,0 +1,13 @@
+Title: check_mk_agent.aix: Fixed multiline output processing
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1538031557
+
+When running MRPE scripts which provide multilines
+a service was created for each line. This led to
+pointless services.
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index e237e0b..084ec1e 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -388,8 +388,9 @@ then
while read descr cmdline
do
PLUGIN=${cmdline%% *}
- OUTPUT=$($cmdline)
- echo "(${PLUGIN##*/}) $descr $? $OUTPUT"
+ OUTPUT=$(eval "$cmdline")
+ echo "(${PLUGIN##*/}) $descr $? $OUTPUT" | tr \\n \\1
+ echo
done
fi