Forum Discussion
STP_88362
Jul 13, 2009Nimbostratus
Posted By hoolio on 07/13/2009 6:54 AM
Hi, could you post the final result for your external monitor using curl for an NTLTM pool?
Thanks,
Aaron
Aaron, here is one of the successful cURL commands against NTLM pools that I have gotten up and running ... (this is on a 9.3.1 setup)
This is used for SharePoint. The grep command would NOT give me a successful response if I queried for specific HTTP responses (i.e. "200 OK") so I had to look for text on the page being requested. It also follows the redirects, as the first time the monitor runs it receives a "401 Unauthorized" which I'm assuming equates to the login box popping up if viewed over a browser. The script tries a login a second time, which is accepted and then looks for the text specified. If you run it from the SSH console you'll see the entire process.
!/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 'username@domain.org:password' http://${IP}:${PORT}/Pages/Default.aspx -H "Host: host.domain.org" | grep -i "Desired text on requested page" 2>&1 > /dev/null
mark node UP if expected response was received
if [ $? -eq 0 ]
then
echo "UP"
fi
rm -f $PIDFILE
exit