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, 2014Hi Patrik,
Thanks for the reply. I've been playing with a bash script to do this but am having some problems that maybe someone here could help with.
"mypool1" is offline, "mypool2" is online. When I run this script with only mypool1 the result I get is 0 (offline) and when I run it with only mypool2 I get 1 (online) and when I run it with both commands I get 1 (online) when I would expect it to be 0.
If I run those commands by themselves for mypool1 I get the text "offline" (expected) and with mypool2 it doesn't return any text (expected).
!/bin/sh
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://'`
tmsh show ltm pool Mypool1_Stg_pool field-fmt | grep -o offline > /dev/null
tmsh show ltm pool Mypool2_Stg_pool field-fmt | grep -o offline > /dev/null
status=$?
echo "$status"
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