Forum Discussion
Rick99_137765
Nimbostratus
Jul 01, 2014Need to monitor pool members to see if they are out of the farm
I don't want to re-invent the wheel if someone has already done this, so I'll ask...
I need to monitor individual members of a pool to see when / if they come out of the pool - either on their o...
Kevin_Stewart
Employee
Jul 02, 2014There's really several ways to do this:
-
user_alert.conf script and/or iCall to capture, in real time, when nodes go up and down. From there you run a script that sends an alert, syslog message, email, SNMP trap, whatever, per event.
-
Run a script that periodically checks all of the pool members for their state (up or down) and session (monitor-enabled or user-disabled). The following is a shell of what that could look like:
!/bin/bash define pool name pool="local-pool"; arr=($(tmsh list ltm pool local-pool |perl -ne 'if (m/([a-zA-Z0-9\.-]+:[^\s]+)\s{/) { print "$1\n"}')); for x in "${arr[@]}" do state=`tmsh list ltm pool $pool members { $x { state } } |grep state |awk -F" " '{ print $2 }'` session=`tmsh list ltm pool $pool members { $x { session } } |grep session |awk -F" " '{ print $2 }'` echo "$x:" echo " state: $state" echo " session: $session" done
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