Forum Discussion
Arron_1084
Nimbostratus
Jun 04, 2014Stacked monitoring?
Hello all, I'm fairly sure someone on here has done this before and am hoping its fairly easy to implement. I'm trying to use the LTM's monitors as a way to take offline non-functioning web servers. ...
Arron_1084
Nimbostratus
Jun 06, 2014I ended up doing this which seems to work when I run the script from the command line. I get "up" if the all of the pools are available, and I get no output if one or more of them is offline.
I applied the monitor to a test pool, and even if the output of the script is null which should mark the test pool offline it doesn't and i'm not sure why...
!/bin/sh
$1 = IP (nnn.nnn.nnn.nnn notation or hostname)
$2 = port (decimal, host byte order)
$3 and higher = additional arguments
In this sample script, $3 is the regular expression
pidfile="/var/run/pinger.$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://'`
pool1=$(tmsh show ltm pool 1_pool field-fmt | grep -o offline)
pool2=$(tmsh show ltm pool 2_pool field-fmt | grep -o offline)
pool3=$(tmsh show ltm pool 3_pool field-fmt | grep -o offline)
pool4=$(tmsh show ltm pool 4_pool field-fmt | grep -o offline)
pool5=$(tmsh show ltm pool 5_pool field-fmt | grep -o offline)
if [ -z "$pool1" ]&&[ -z "$pool2" ]&&[ -z "$pool3" ]&&[ -z "$pool4" ]&&[ -z "$pool5" ];
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