Forum Discussion
MSK_222682
Feb 24, 2016Nimbostratus
Script to export list of Virtual Servers attached with HTTP profiles
Hi,
I'm been asked to update all the virtual servers having http profile with logging iRule. Now, in my environment I have thousands of virtuals servers in each BIG IP of APAC/ EMEA / US and the...
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
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