Forum Discussion
Tony_Jarvis_132
Altostratus
Jun 25, 2014Use iRules to query number of active connections against a node
I am currently trying to automate a lot of the "out of the box" behaviour available on the BIG-IP using iRules which is, to say the least, quite a task. The reason for doing this is that we have an e...
Kevin_Stewart
Employee
Jun 26, 2014Okay, so give this a shot:
Shell script:
!/bin/bash
user-defined: dns_server
dns_server="10.80.0.200"
user-defined: host to resolve
host="tester.mydomain.com"
user-defined: host port
host_port="80"
user-defined: pool to update
pool="tester-pool"
lookup=($(dig @$dns_server $host +short))
pre-define host_list
host_list=""
for x in ${lookup[@]}
do
host_list="$host_list $x:$host_port"
done
if [ "$host_list" != "" ]
then
tmsh modify ltm pool $pool members replace-all-with { $host_list }
fi
Create a cli script to point to the shell script:
> tmsh create sys icall script update-pool
create script update-pool {
app-service none
definition {
set update [catch {exec /config/dev/archive/update-pool.sh}]
}
description none
events none
}
** modify the above to point to your shell script
Create a periodic iCall:
create sys icall handler periodic update-pool script update-pool status active interval 300
This will create a periodic (I know I said "perpetual" but I meant periodic) script to completely update the given pool with the returned DNS values.
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