Forum Discussion
convert custom script from v9 to v11
here is the custom node management script running at v9, can someone kindly help to convert it using tmsh command? Many thanks.
!/bin/sh
prog="nodemgmt"
enable() { change_status "enable" "up" }
disable() { change_status "disable" "down" }
status() { show_status }
show_status() { for pool in $(seq 0 $((${POOL_ARRAY[@]} - 1))) do p=${POOL_ARRAY[$pool]} m=${MEMBER_ARRAY[$pool]} b pool $p member $m done }
change_status() { for pool in $(seq 0 $((${POOL_ARRAY[@]} - 1))) do p=${POOL_ARRAY[$pool]} m=${MEMBER_ARRAY[$pool]} b pool $p member $m session $1 $2 echo "$1 pool $p, member $m $2, status: $?" done }
case "$1" in enable) . $2 enable ;; disable) . $2 disable ;; status) . $2 status ;; *) echo $"Usage: $prog {enable|disable|status} " RETVAL=1 esac
exit $RETVAL
3 Replies
- Kevin_Stewart
Employee
I think there's a piece of the puzzle missing here, so I can only really convert the b commands.
b pool $p member $mshould become
tmsh show ltm pool $p members { $m }For change_status:
b pool $p member $m session $1 $2should become
tmsh modify ltm pool $p members modify { $m { session $2 } }The values allowed here for session are "user-enabled" and "user-disabled", so you may need to modify your input.
- spaceage53_8664
Nimbostratus
Try this chart. It should help a bit
https://devcentral.f5.com/wiki/tmsh.BigpipeMappings.ashx
- cjunior
Nacreous
One question, how do it fills those arrays? I asked because the display results in tmsh were changed too.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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