Forum Discussion

robertbrunwin_7's avatar
robertbrunwin_7
Icon for Nimbostratus rankNimbostratus
Jul 14, 2008

external monitor

Hi Network Pros,

 

Thanks in advance for looking over this problem; hopefully there's an obvious point I've missed.

 

 

I'm attempting to implement an external monitor which will report and take action based on the status of JVMs configured on application servers running Caucho's Resin. I have a BigIP configuration in which Virtual Servers consisting of pools of web servers pass traffic to the Resin application servers which utilize Resin's cluster configuration to find a server which then serves up the pages. The problem I have is that when JVMs are restarted, the preconfigured 'site down' static pages don't work because the web server gets a '200' response from the application server: "can't access url" or "servlet error".

 

 

I've setup an external monitor based on HTTPMonitor_cURL_BasicGET from the codeshare (http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=151) and this is it:

 

 

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 and check for expected response

 

curl -fNs 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

 

 

 

 

The script works correctly when run from the shell using target IP and port as arguments (echos "UP" when successful and nothing when not), but once setup as a monitor it always marks the pool member as 'down'.

 

 

I've been trying different strings to look for in the cURL response to no avail and I'm using the steps outlined in http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=152 to troubleshoot but haven't hit on the problem.

 

 

I'd appreciate any advice.

2 Replies

  • I suggest trying a standard HTTP monitor. It's more efficient than an external monitor and should provide the functionality you're looking for. You can configure the send string with the URI you want to make a request to. Then configure the receive string with a string only found in the first 5120 bytes of the response if the full chain of servers is up. You can test this from the BIG-IP using curl:

     

     

    curl http://1.1.1.1:8080/path/to/file.ext

     

     

    Compare the response when the app is up versus when it is down.

     

     

    Aaron