Forum Discussion
Shoaib_020
Nov 29, 2023Altostratus
Need help in finding pools with only only one pool member
Hello, I need help in finding pools with only only one pool member. Please let me know if this can be done via any command or script.
- Nov 29, 2023
I would start with:
From cil - in bash...
tmsh list ltm pool all members
and start my filter with
tmsh list ltm pool all members |egrep 'ltm pool|address'
if you dont need/use ipv6
tmsh list ltm pool all members |egrep 'ltm pool|address' |egrep -v 'any6'
that should get you close
- Nov 29, 2023
You can achieve this using a simple bash script. For example:
# Author: Michael Saleem # Filename: f5-list-pools-based-on-member-quantity.sh # Purpose: This script will list all pools containing a specified number of pool members #!/bin/bash POOL_MEMBER_QUANTITY=1 POOLS=$(tmsh list ltm pool one-line | awk '{print $3}') for POOL in $POOLS; do POOL_MEMBER_COUNT=$(tmsh list ltm pool $POOL one-line | awk -F':' '{print NF -1}';) if [ "$POOL_MEMBER_COUNT" = "$POOL_MEMBER_QUANTITY" ] then echo $POOL fi done
Nov 29, 2023
You can achieve this using a simple bash script. For example:
# Author: Michael Saleem
# Filename: f5-list-pools-based-on-member-quantity.sh
# Purpose: This script will list all pools containing a specified number of pool members
#!/bin/bash
POOL_MEMBER_QUANTITY=1
POOLS=$(tmsh list ltm pool one-line | awk '{print $3}')
for POOL in $POOLS; do
POOL_MEMBER_COUNT=$(tmsh list ltm pool $POOL one-line | awk -F':' '{print NF -1}';)
if [ "$POOL_MEMBER_COUNT" = "$POOL_MEMBER_QUANTITY" ]
then echo $POOL
fi
done
- Shoaib_020Nov 29, 2023Altostratus
Thank you very much for the script.
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