Forum Discussion

Will_F_98397's avatar
Will_F_98397
Icon for Nimbostratus rankNimbostratus
May 10, 2010

External Monitor not working

Hello,

 

I've configured an external monitor for a SOAP page I'm trying to contact as described here: http://devcentral.f5.com/wiki/default.aspx/AdvDesignConfig/HTTPMonitor_cURL_BasicPOST.html I've assigned the monitor to a pool but it doesnt appear to be working. I've added some echo's to the top of the script with output to a file but I still don't see this, it's like the monitor isnt even being called.

 

 

I've confirmed the script run's via the CLI and permissions are correct.

 

 

Does anyone have any ideas why this may not be working?

 

 

 

-rwxrwxrwx 1 root root 2303 May 10 18:46 curl_monitor.sh monitor externalmonitorforxyz { defaults from external dest *.* DATA "@echo.xml" RECV "Data" run "/usr/bin/monitors/curl_monitor.sh" URI "/XML" } curl_monitor.sh: NODE=`echo ${1} | sed 's/::ffff://'` PORT=${2} 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 echo "EAV exceeded runtime needed to kill ${IP}:${PORT}" | logger -p local0.error kill -9 `cat $PIDFILE` > /dev/null 2>&1 fi echo "$$" > $PIDFILE send request & check for expected response echo "hello" >> /tmp/curl.log echo "curl -fNs http://${NODE}:${PORT}${URI} -d "${DATA}" | grep -i "${RECV}" 2>&1 > /dev/null" >> /tmp/curl.log mark node UP if expected response was received if [ $? -eq 0 ] then echo "UP" fi rm -f $PIDFILE exit

5 Replies

  • Redesigned using this template http://devcentral.f5.com/wiki/default.aspx/AdvDesignConfig/TemplateForExternalLtmMonitors.html working now.
  • Using that template, I had a lot of trouble with the debug code. The script seemed to only work when debug was set to "1". I took the debug code out and it's working as expected.
  • Hi Will,

     

     

    Can you elaborate? I've tested with debug set to 0 in the monitor definition as well as the script and not seen any issues.

     

     

    Thanks, Aaron
  • Hi Aaron I added this line to the script:
     Send the request request and check the response
    nc $IP $PORT | grep "my receive string" 2>&1 > /dev/null
    
    curl -fNs -H "Content-Type: application/soap+xml;charset=UTF-8" http://${IP}:${PORT}/${URI} -d @${DATA} | grep ${RECV} 2>&1 > /dev/null
    
    It didn't even look like it was getting through to "echo UP" although $? returned as 0 before entering the if statement. Might have been an issue with the curl, but I couldn't spot it, and worked fine with debug=1.
    if [ $? -eq 0 ]
    then
       rm -f $pidfile
       if [ $DEBUG -eq 1 ]; then echo "EAV `basename $0`: Succeeded for ${IP}:${PORT}" | logger -p local0.debug; fi
        echo UP
    
    
    monitor curl_external {
       defaults from external
       DATA "/usr/bin/monitors/request.xml"
       DEBUG "0"
       RECV "string here"
       run "curl_monitor.sh"
       URI "query URI"
    }
    
    If you wonder why I didn't use the SOAP monitor instead of a curl, it's because it didn't seem to support the correct soap envelope I was after (http://www.w3.org/2003/05/soap-envelope instead of http://schemas.xmlsoap.org/soap/envelope/)

    Running BIG-IP 9.4.7 Build 320.1 Final

    Will
  • I just tested with a shell call to ping in the same monitor template and it worked find with and without debug enabled as well as with/without debug defined in the monitor. It looks like it might be specific to curl...

     

     

    Aaron