Created
December 3, 2013 08:29
-
-
Save sts/7765840 to your computer and use it in GitHub Desktop.
Check_MK use /etc/check_mk/mrpe.d instead of /etc/check_mk/mrpe.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MK's Remote Plugin Executor NG ;-) | |
# | |
# Workaround for check_mks inability to use scripts from a mrpe.d directory | |
# http://lists.mathias-kettner.de/pipermail/checkmk-en/2013-February/008646.html | |
# | |
# Make sure mrpe.cfg doesn't exist, or you will end up with two <<<mrpe>>> | |
# output sections. | |
# | |
if [ "$(ls -A /etc/check_mk/mrpe.d)" ] ; then | |
echo '<<<mrpe>>>' | |
grep -rhEv '^[[:space:]]*($|#)' "/etc/check_mk/mrpe.d" | | |
while read descr cmdline | |
do | |
PLUGIN=${cmdline%% *} | |
OUTPUT=$(eval "$cmdline") | |
echo -n "(${PLUGIN##*/}) $descr $? $OUTPUT" | tr \\n \\1 | |
echo | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please mind the great fork of this, running all scripts in parallel: https://gist.github.com/Grauwolf/8335012