VFB
Nov 29, 2023Cirrus
remove a node from multiple pools using bash
I have a node that I would like to delete from multiple pools that is running on different ports. I tried the command below, and while it removes some, I noticed it doesn't delete the members that are in offline or disabled mode. Any help would be grateful.
node="10.131.131.5"; tmsh list ltm pool one-line | grep -E "${node}:[[:alnum:]]" | \ sed -r 's/ltm pool ([^ ]+).*members.*('${node}':[[:alnum:]]+).*/tmsh modify ltm pool \1 members delete { \2 }/g' | bash -x