Forum Discussion
Julio_Navarro
Cirrostratus
Oct 16, 2015Dynamic Variable - Node IP - https monitor
Hello;
I am trying to find a way to have the "GET" option have the IP of the node being monitor:
GET /common/access.asp?REFR=https://{$IP}/dummy/site.asp\r\n
{$IP} will be replace by the IP of ...
Andy_McGrath
Cumulonimbus
Oct 17, 2015Two options: 1. Either configure a monitor per pool member/node and assign directly under each pool member (instead of the pool) 2. Configure an external monitor, the following external monitor script should work for you.
!/bin/sh
This removes the IPv6/IPv4 compatibility prefix. This has to be done because the LTM passes addresses in IPv6 format.
IP=`echo ${1} | sed 's/::ffff://'`
PORT=${2}
PIDFILE="/var/run/`basename ${0}`.${IP}_${PORT}.pid"
This will kill off the last instance of this monitor if it is hung and logs current PID
if [ -f $PIDFILE ]
then
kill -9 `cat $PIDFILE` > /dev/null 2>&1
fi
echo "$$" > $PIDFILE
This is the meat of the code, it is responsible for sending the request & checking for the expected response.
curl -fNs -k -v http://${IP}:${PORT}/common/access.asp?REFR=https://{$IP}/dummy/site.asp -H "Host: ${host}" | grep -i "${rstring}" 2>&1 > /dev/null
This part of the code will mark the node UP if the expected response was received.
if [ $? -eq 0 ]
then
echo "UP"
fi
rm -f $PIDFILE
exitHelp 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