Forum Discussion
Dbow_21284
Jul 13, 2009Nimbostratus
So my results are above and my script is below:
!/bin/sh
remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)
IP=`echo ${1} | sed 's/::ffff://'`
IP=${1}
PORT=${2}
PIDFILE="/var/run/`basename ${0}`.${IP}_${PORT}.pid"
kill of the last instance of this monitor if hung and log current pid
if [ -f $PIDFILE ]
then
kill -9 `cat $PIDFILE` > /dev/null 2>&1
fi
echo "$$" > $PIDFILE
send request & check for expected response
curl -L --ntlm -k -v --user 'me@me.org:mememe' http://${IP}:${PORT}/whatsup.aspx -H "Host: intranet.acc.org" | grep -i "1-UP" 2>&1 > /dev/null
mark node UP if expected response was received
if [ $? -eq 0 ]
then
echo "UP"
fi
rm -f $PIDFILE
exit
I figured someone would want to see my script, here it is.