Forum Discussion
CraigM_17826
Altocumulus
Mar 16, 2010External Monitor not working
Hi all,
I am having some odd issues with a monitor. I have a web application I need to monitor and for whatever reason a HTPS monitor does not seem to work. The status of the pool always stays as "Unknown (Enabled)"
In desperation I am now trying to use a external monitor. Using the sample_monitor.sh script in /usr/bin/monitors as a basis for my monitor. The script uses three arguments, hostname/ip, URI and expected string. If the output of curl contains the extected string then it returns UP, else it returns DOWN.
Now the script runs and works as expected when I execute it from the command line, but when I create a external monitor to run this script with the required parameters the status of the pool remains as "Unknown". I decided to put in a debug line in the script that creates a logfile and writes to the logfile at certain points within the script. This logfile is never created which seems to inidicate the monitor is not being run.
Any ideas on why this would be the case? All I see is this in the LTM logfile once I apply the monitor to my test pool
Mar 16 15:59:12 local/bigip-u1 notice mcpd[1657]: 01070638:5: Pool member nnn.nnn.nnn.nnn:443 monitor status unchecked.
Here is the monitor shell script
!/bin/sh
LOGFN="/tmp/exam-services.log"
touch $LOGFN
echo "Starting exam-services monitor" >>$LOGFN
remove IPv6/IPv4 compatibility prefix (LTM passes addresses in IPv6 format)
IP=`echo ${1} | sed 's/::ffff://'`
PIDFILE="/var/run/`basename ${0}`.${IP}.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
echo "PIDFILE $PIDFILE created" >>$LOGFN
send request & check for expected response
using -k as Monash use a self signed certificate
echo "Executing CURL command" >>$LOGFN
curl -fNsvk https://${IP}/exam-services/student 2>&1 | grep -i "/exam-services" 2>&1 > /dev/null
mark node UP if expected response was received
if [ $? -eq 0 ]
then
echo "UP"
echo "Exam Services Website is up." >>$LOGFN
else
echo "DOWN"
echo "Exam Servicews Website is down." >>$LOGFN
fi
rm -f $PIDFILE
echo "Exiting exam-services monitor" >>$LOGFN
exit
and in the health monitor GUI setup screen I have
External Program: /usr/bin/monitors/examservices_monitor.sh
Arguments:
I have actually tried just specifying the scipt name unqualified in the External Program field as well and there was no difference.
Everything else is left at their default values.
As I mentioned, it all works when I run from the command line.
Regards
Craig
p.s. Sorry, omitted to mention we are running 10.0.1 Build 378.0 with HF3.
20 Replies
- You might have better luck posting this in the monitoring section..
- JRahm
Admin
Check the permissions on the monitor, should be be read/write/execute by root. Moving this topic to monitor forum. - CraigM_17826
Altocumulus
Hi all,-rwxr--r-x 1 root root 978 Mar 16 16:02 examservices_monitor.sh
- hwidjaja_37598
Altostratus
- Can you send us the monitor's setting? (eg. b monitor list and b pool list) - hwidjaja_37598
Altostratus
And also to test your monitor setting, create a simple external script eg.!/bin/sh echo $1 $2 >> /tmp/test.log
- hwidjaja_37598
Altostratus
Hmm ... Try restarting bigd, or if possible, restart the box. - CraigM_17826
Altocumulus
Hi Hum, - hwidjaja_37598
Altostratus
Hi Craig, - CraigM_17826
Altocumulus
Hi Hum, - Hmm that's odd.. what's the difference between the two boxes? How is the environment set up? Are these inline or do you typically SNAT?
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