Forum Discussion
Ricardo_77091
Nimbostratus
Mar 26, 2009HTTP Monitor that follows redirects
We are trying to configure an HTTP monitor to monitor a .NET application and mark the member as down if it does not receive the response it expects. The problem is that the first response is a 401 Una...
STP_88362
Nimbostratus
Jul 13, 2009Posted 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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects