Forum Discussion
Kevin_Stewart
Jun 26, 2014Employee
Okay, 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.