You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Princeton/pu/libexec/check_nrpe_agent

21 lines
476 B
Bash

#!/bin/sh
plugins=/usr/local/monitoring/nagios/libexec
port=9666
timeout=60
if [[ "$#" -ne "1" ]]; then echo "Usage: check_nrpe_agent <hostname>"; exit 3; fi
host=$1
out=`${plugins}/check_nrpe -t $timeout -H $host -p $port 2>&1`
stat=$?
if [[ "$stat" -gt "3" ]]; then
stat=2
fi
out=`echo "$out" | sed 's/^\(CHECK_NRPE: Socket timeout\|Connection refused\|connect.*No route to host\).*$/The NRPE Agent is **NOT** responding!!! Do **NOT** ignore!/'`
echo $out
exit $stat