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
@VFB Yes, I do realize what the output should be but I’m looking for what it is for you to ensure that what you have command wise will work or we can figure out why it doesn’t work. Ideally I would like to see two of the lines, one with all pool members active/working and one with some down/disabled pool members.
@VFB Based on the configuration that you provided the following is the result. Is that what you expect to occur? If this is automatically echoing the commands back into the console this might be some sort of lag that is occurring between the output and input into the console. You might run the command and manually put the commands in yourself.
tmsh modify ltm pool imagine members delete { 10.131.131.5:443 }
tmsh modify ltm pool operations members delete { 10.131.131.5:80 }
tmsh modify ltm pool treasury members delete { 10.131.131.5:80 }
Thanks for the response, but I’m looking for a scripted solution to delete possibly thousands of entries. I’m looking for help modifying the script I initiall posted.