Forum Discussion
HTTPMonitor_cURL_ProbeTimeout
I cannot use the http monitor as the string I need to recieve is longer than 5120 bytes
The following script should work but I don't know how to implement it
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
kill -9 `cat $PIDFILE` > /dev/null 2>&1
fi
echo "$$" > $PIDFILE
CAUCHOPORT=4000
POOL=cwmp.stage.443
URI=/caucho-status
P_TIMEOUT=5
send request & check for expected response
for i in `seq 1 2`; do
curl -fNs -m ${P_TIMEOUT} http://w50-$i.c50.domain.com:${CAUCHOPORT}${URI} | grep -io "w50-$i"'.c50.domain.com:6802 .ok.' 2>&1 > /dev/null
exstatus=$?
echo "exstatus = $exstatus"
let bigd mark node UP if expected response was received
otherwise force the node DOWN immediately
if [ $exstatus -eq 0 ]
then
echo bigpipe pool ${POOL} member 10.50.1.$i up 2>&1 > /dev/null
else
echo bigpipe pool ${POOL} member 10.50.1.$i down 2>&1 > /dev/null
fi
rm -f $PIDFILE
done
exit
27 Replies
- Deb_Allen_18Historic F5 AccountThe Adv Design & Config "ExternalMonitor" wiki page (Click here) has the implementation details you're looking for.
- pgroven_71837
Nimbostratus
The directions say to put it in /config/eav but the F5 insists it be in /usr/bin/monitors - Deb_Allen_18Historic F5 AccountOK, wiki page is updated to indicate the correct directory, sorry for the confusion there.
- Deb_Allen_18Historic F5 AccountOK...
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 -fNs -m ${P_TIMEOUT} http://${IP}:${PORT}${URI} | grep -i "${RECV}" 2>&1 > /dev/null let bigd mark node UP if expected response was received otherwise force the node DOWN immediately if [ $? -eq 0 ] then echo "UP" else /bin/bigpipe pool ${POOL} member ${IP}:${PORT} down 2>&1 > /dev/null fi rm -f $PIDFILE exit
RECV=w50-[12].c50.domain.com:6802 .ok. POOL=cwmp.stage.443 URI=/caucho-status P_TIMEOUT=5
- pgroven_71837
Nimbostratus
The script above did not work - Deb_Allen_18Historic F5 AccountThen you would want to use the supplied script and define the monitor template with the alias port of 4000, and it will pass it to the monitor as $2 / $PORT, rather than adding yet another variable with the same value.
- pgroven_71837
Nimbostratus
Whether I put the 4000 in the GUI template or the script it still marks all servers as down. - Deb_Allen_18Historic F5 AccountYour original script might work fine as a standalone, but if you are going to run it as a monitor, there are some special considerations you must take into account when coding. Review my first response for details.
- pgroven_71837
Nimbostratus
Attached is the monitor pool and virtual server configsServer: w50-1.c50.domain.com
Config: /var/cms/conf/resin.conf
Server Start: Wed, 12 Dec 2007 14:28:23 -0800 (PST)
Server Reload: Wed, 12 Dec 2007 14:28:23 -0800 (PST)
Total Memory: 769.26Meg
Free Memory: 32.08Meg
Current Threads Config
Protocolort Active Keepalive Total thread-max keepalive-max request-timeout
srun:6802 1 0 6 200 100 65
http:8080 1 0 3 200 100 65
Host Active Count live-time dead-time request-timeout
1. w50-1.c50.domain.com:6802 (ok) 0 15 15 30
2. w50-2.c50.domain.com:6802 (ok) 0 15 15 30
- Deb_Allen_18Historic F5 AccountThe script and monitor definition look fine, unless your servers are expecting an HTTPS request.
Recent Discussions
Related Content
* 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