Forum Discussion
arpydays
Feb 25, 2016Nimbostratus
Save this as an executable script and run it, it should list the VS name, VS IP and pool member IPs.
cheers
!/bin/bash
List VSs with 'http' profile name
VS=`tmsh -q -c "list ltm virtual recursive profiles {http} " | awk 'BEGIN {RS="\n}"} !/\ none/ {print}'| grep ^ltm | awk '{print $3}'`
Get pool name for each VS
for all in ${VS}
do
POOL=`tmsh -q list ltm virtual $all pool | awk '/pool/ {print $2}'`
DESTINATION=`tmsh -q list ltm virtual $all destination | awk -F'[ :]' '/destination/ {print $6}'`
if [ "$POOL" != "none" ]
then
POOLIP=`tmsh list ltm pool $POOL members| awk -F '[ :]' -v ORS=", " '/^ +[0-9]/ {print $9; count++ }'`
else
POOLIP="-"
fi
printf "%-45s %-20s %-20s %-s\n" "$all" "$DESTINATION" "$POOLIP"
done