Thanks Hoolio, we've tried using your suggestion in conjunction with one of the template scripts we found in devcentral (see below) but we are still unable to get it to work ie. when doing a tcpdump we can see the packets hitting the destination pool member but we keep getting a 401 Unauthorized response. When running the same curl command, with the same logon credentials, locally on the desktop as a test, we get successful communication, ie. curl follows the redirects correctly and eventually receives a 200 OK.
We placed the script in the /usr/bin/monitors folder and referenced it in the monitor template via the GUI, specifying the variables "URI = /" and "RECV = HTTP/1.1 200".
Using this as the only monitor for the pool, the two members are shown as marked down. Anyone have any ideas ?
remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)
IP=`echo ${1} | sed 's/::ffff://'`
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 -b cookie.txt -c cookie.txt --ntlm -k -v -u domain\username:password http://${IP}:${PORT}${URI} | 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