Forum Discussion
Shankar_Gandhi_
Apr 18, 2011Nimbostratus
This External monitor logs into the specified URL and checks for the content, If specified content matches then only the pool member will be placed in load if not it will be out of load.
After two weeks ups and downs ,I got an External monitor configured for one of our application .,I have followed below steps to get this done.
Step 1 :Logged into node under /config/monitors created a file with httpmonitor_curl_post and added below script
remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)
NODE=`echo ${1} | sed 's/::ffff://'`
PORT=${2}
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 ${IP}:${PORT}" | logger -p local0.error
kill -9 `cat $PIDFILE` > /dev/null 2>&1
fi
echo "$$" > $PIDFILE
send request & check for expected response
curl -fNs http://${NODE}:${PORT}${URI} -d "${DATA}" | grep -i "${RECV}" 2>&1 > /dev/null
curl -fNs -i -L -H "Host: ${HOST}" "http://${NODE}:${PORT}${URI}" -b cookies.txt -d "${DATA}" | grep -i "${RECV}" 2>&1 > /dev/null
mark node UP if expected response was received
if [ $? -eq 0 ]
then
echo "UP"
fi
rm -f $PIDFILE
exit
Step 2: Logged into F5 GUI mode and created a external monitor with name http_Curl_post and under external monitor added the one which I created in step 1 ( httpmonitor_curl_post)
Step 3: Under Variables added
Host= hostname:port
URI=complete URL after .com
DATA= timezoneOffset=-330&userid=username&pwd=Password
RECV= Keyword which it need to check
Step 4 :Assign this external monitor to the pool.
I would like to say thanks Nobel & Nitass for helping on this.
http://www.thef5guy.com/blog/2010/08/sharepoint-2010-ntlm-and-big-ip-health-monitors/
http://ask.metafilter.com/18923/How-do-you-handle-authentication-via-cookie-with-CURL
Thanks
S.Shankar Gandhi