nagios-nrpe: corrige les cas où un check est défini plusieurs fois ou commenté

This commit is contained in:
William Hirigoyen 2023-06-21 16:14:35 +02:00
parent aec5406043
commit 64c1da40b0

View file

@ -6,7 +6,7 @@ if ! test -f /usr/lib/nagios/plugins/check_nrpe; then
fi
if [ -r /etc/nagios/nrpe.d/evolix.cfg ]; then
command=$(grep "check_$1" /etc/nagios/nrpe.d/evolix.cfg | tail -n1 | cut -d'=' -f2-)
command=$(grep "check_$1" /etc/nagios/nrpe.d/evolix.cfg | grep -v '^[[:blank:]]*#' | tail -n1 | cut -d'=' -f2-)
echo "Command:"
echo " $command"
fi