Branch: refs/heads/2.1.0
Home:
https://github.com/Checkmk/checkmk
Commit: 3331d037f460077112e471288525056261c6e87b
https://github.com/Checkmk/checkmk/commit/3331d037f460077112e47128852505626…
Author: Benedikt Seidl <benedikt.seidl(a)checkmk.com>
Date: 2023-11-21 (Tue, 21 Nov 2023)
Changed paths:
A .werks/15311
M agents/check_mk_agent.linux
Log Message:
-----------
15311 FIX align quoting of synchronous and asynchronous MRPE
You are affected by this change if you use asynchronous MRPE and used
double quotes (<tt>"</tt>) in the MRPE command.
Quoting of mrpe commands differed between cached and non cached mrpe
checks.
With this Werk the quoting rules for the normal/synchronous execution of
MRPE are applied to asynchronous MRPE commands.
The following can now be applied to both asynchronous and
normal/synchronous execution of MRPE commands: Use single quotes on the
first level of quoting.
This command will correctly show <tt>output with spaces</tt> in the
Service output:
<tt>bash -c 'echo "output with spaces"'</tt>
If you execute asynchronous MRPE and the command uses double quotes on
the first level of quoting, adapt it accordingly.
--------------------------------------------------------------------------------
The new behaviour will show "output sync" and "output async" for the
quoting used in the script. Before this change, single and double quotes
would have to be exchanged for the async command.
-------------------------------------- 8< --------------------------------------
export MK_VARDIR=/tmp/
export MK_CONFDIR="."
rm -r /tmp/cache
cat >./mrpe_sync.cfg <<EOF
some_ident (appendage=1) bash -c 'echo "output sync"'
EOF
cat >./mrpe_async.cfg <<EOF
some_ident (interval=666:appendage=1) bash -c 'echo "output async"'
EOF
MK_SOURCE_AGENT=1
. agents/check_mk_agent.linux
main_setup
echo "# execute sync"
run_remote_plugins "./mrpe_sync.cfg" ""
echo "# prepare async"
run_remote_plugins "./mrpe_async.cfg" ""
sleep 1
echo "# async output"
run_remote_plugins "./mrpe_async.cfg" ""
echo "# done"
-------------------------------------- >8 --------------------------------------
SUP-15046
Change-Id: Ie511148897ca198c3b13d173db10e230054b2323