Forum Discussion
Leon_Archambau1
Jan 30, 2014Historic F5 Account
!/bin/sh
These arguments supplied automatically for all external monitors:
$1 = IP (nnn.nnn.nnn.nnn notation)
$2 = port (decimal, host byte order)
Remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)
NODE=`echo ${1} | sed 's/::ffff://'`
PORT=${2}
remotefile="Health_Check.cm"
localfile="Health_Check.cm"
PIDFILE="/var/run/`basename ${0}`.${NODE}_${PORT}.pid"
kill of the last instance of this monitor if hung and log current pid
if [ -f $PIDFILE ]
then
echo "EAV exceeded runtime needed to kill ${NODE}:${PORT}" | logger -p local0.error
kill -9 `cat $PIDFILE` > /dev/null 2>&1
fi
echo "$$" > $PIDFILE
/usr/bin/tftp $NODE -c get $remotefile $localfile 2>&1 | /bin/egrep -q "Error|timed"
STATUS=$?
rm -f $PIDFILE
if [ $STATUS -eq 1 ]
then
echo "UP"
fi
Exit