ansible-roles/nagios-nrpe/files/check-local

17 lines
461 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
if ! test -f /usr/lib/nagios/plugins/check_nrpe; then
echo '/usr/lib/nagios/plugins/check_nrpe is missing, please install nagios-nrpe-plugin package.'
exit 1
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-)
printf "Command:\n $command\n"
fi
printf "NRPE daemon output:"
/usr/lib/nagios/plugins/check_nrpe -H 127.0.0.1 -c "check_$1"