Forum Discussion
Will_97818
Nimbostratus
Aug 16, 2013Using variable to set http file we test in a probe
We are using an http get of a file to validate the listener is up. We are using the port number as the file we are getting. an example today we have the following.
send "GET /8080.active HTTP/1....
Kevin_Stewart
Employee
Aug 16, 2013In a standard HTTP monitor, no.
In an external monitor, using cURL, absolutely. Take a look at the BASH-based sample_monitor in /config/monitors. The external monitor profile sends the IP of the pool member as $1 and the port as $2, and any arguments (potentially your receive string if not hard coded) as $3. So something like this:
!/bin/sh
these arguments supplied automatically for all external pingers:
$1 = IP (::ffff:nnn.nnn.nnn.nnn notation or hostname)
$2 = port (decimal, host byte order)
$3 and higher = additional arguments
pidfile="/var/run/$MONITOR_NAME.$1..$2.pid"
if [ -f $pidfile ]
then
kill -9 -`cat $pidfile` > /dev/null 2>&1
fi
echo "$$" > $pidfile
node_ip=`echo $1 | sed 's/::ffff://'`
curl -fNs http://$node_ip:$2 |grep $3 1> /dev/null
status=$?
if [ $status -eq 0 ]
then
echo "up"
fi
rm -f $pidfile
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