Forum Discussion
momo_84865
Nimbostratus
May 15, 2014custom script to turn on / off of nodes for bigip v11
Dear all,
I created a custom script to handle the batch process to turn on / off for a desire nodes, it work with the config file that store pool name and node ip:port with the below format. whe...
Kevin_Stewart
Employee
May 16, 2014A little different, but I think this should work:
!/bin/sh
prog="nodemgmt"
enable() {
change_status "user-enabled" "user-up"
}
disable() {
change_status "user-disabled" "user-down"
}
status() {
show_status
}
show_status () {
while read line
do
a=( $line )
p=${a[0]}
m=${a[1]}
tmsh show ltm pool $p members {$m}
done < $data
}
change_status() {
while read line
do
a=( $line )
p=${a[0]}
m=${a[1]}
tmsh modify ltm pool $p members modify { $m { session $1 state $2 } }
echo "$1 pool $p, member $m $2, status: $?"
done < $data
}
case "$1" in
user-enabled)
data=$2
enable
;;
user-disabled)
data=$2
disable
;;
status)
data=$2
status
;;
*)
echo $"Usage: $prog {user-enabled|user-disabled|status} config file "
RETVAL=1
esac
exit $RETVAL
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