2023-05-25 16:01:04 +02:00
|
|
|
#!/usr/bin/env bash
|
2023-05-12 12:35:49 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-05-25 16:01:04 +02:00
|
|
|
if [ -r /etc/nagios/nrpe.d/evolix.cfg ]; then
|
2023-06-21 16:14:35 +02:00
|
|
|
command=$(grep "check_$1" /etc/nagios/nrpe.d/evolix.cfg | grep -v '^[[:blank:]]*#' | tail -n1 | cut -d'=' -f2-)
|
2023-05-25 16:02:27 +02:00
|
|
|
echo "Command:"
|
|
|
|
echo " $command"
|
2023-05-25 16:01:04 +02:00
|
|
|
fi
|
2023-05-12 12:35:49 +02:00
|
|
|
|
2023-05-25 16:02:27 +02:00
|
|
|
echo "NRPE daemon output:"
|
2023-05-12 12:38:40 +02:00
|
|
|
/usr/lib/nagios/plugins/check_nrpe -H 127.0.0.1 -c "check_$1"
|
2023-05-12 12:35:49 +02:00
|
|
|
|
|
|
|
|