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..
http://devcentral.f5.com/Default.aspx?tabid=53&view=topics&forumid=32 - 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,
The permissions appear to be fine-rwxr--r-x 1 root root 978 Mar 16 16:02 examservices_monitor.sh
Any other ideas anyone?
Craig - hwidjaja_37598
Altostratus
- Can you send us the monitor's setting? (eg. b monitor list and b pool list)
- Try running curl from shell, do you see the expected result?
eg. curl -kv https://x.x.x.x/exam-services/student 2>&1 | grep -i "/exam-services"
- FYI, printing "DOWN" and any words will mark the pool member up.
- Try enabling bigd debug (eg. b db bigd.debug enable ) and review /var/log/bigdlog.
- Check log file (eg. grep /var/log/ltm | tail -30) - hwidjaja_37598
Altostratus
And also to test your monitor setting, create a simple external script eg.!/bin/sh echo $1 $2 >> /tmp/test.log
Check whether the log file is increasing (eg. tail -f /tmp/test.log) - hwidjaja_37598
Altostratus
Hmm ... Try restarting bigd, or if possible, restart the box.
Is there any issue with other monitor? - CraigM_17826
Altocumulus
Hi Hum,
yes, the other monitors are also playing up. It seems that they work for a very short time on a reboot (well most of them do) and go into a UP state, but stay in the UP state regradless of whether the nodes are accessible or not.
What effect will restarting bigd have on the unit? Will it drop connections or cause service interuptions?
Regards,
Craig - hwidjaja_37598
Altostratus
Hi Craig,
bigd is responsible with health check. When it's not running, monitors are not available.
If it's a production unit, I recommend to do it in a maintenance window.
Or, you may want to work with F5 support? Anyone else has idea? - CraigM_17826
Altocumulus
Hi Hum,
ok, I'll try restarting the bigd service. Very odd, I was going to test this out on the standby unit and noticed the external health monitor is working on the standby unit but not the live unit. I think I will schedule a failover and see how things go.
Craig - 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?
If they're inline and your doing a bunch of self IPs I would verify self IPs between boxes...
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