I 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