Forum Discussion

feversl_29467's avatar
feversl_29467
Icon for Nimbostratus rankNimbostratus
May 02, 2014

Is there a script that could retrieve WIPs and pools from the GTM ?

I am looking for a way to export of all the F5 load balanced URLs listing the URL that is load balanced, assigned VIP and IPs of the servers that participate in that LB Pool. I have heard that I can use an iControl script to gather this infomation starting with the GTM and then then issue commands against the LTMs to retrieve the pool members associated with each VIP that is referenced by a WIP. Thanks

 

1 Reply

  • Hi,

    here is a one-liner on this subject. Just replace the name of the wideip, please.

    In my sample I used the wideip of "www.sub.lb-net.bit".

    Thanks,

    Stephan
     tmsh list gtm wideip www.sub.lb-net.bit one-line | grep -E -o 'pools \{ ([^ ]+ \{ [^\}]+ \} )+\}' | \
    sed -r -e 's/^pools //g' -e 's/(^\{ | \}$)//g' -e 's/\{[^\}]+\}//g' -e 's/[[:space:]]$//g' -e 's/[[:space:]]+/\n/g' | \
    awk '{print "tmsh list gtm pool",$1,"one-line"}' | bash +x | grep -E -o 'members \{ ([^ ]+ \{ [^\}]+ \} )+\}' | \
    sed -r -e 's/^members //g' -e 's/(^\{ | \}$)//g' -e 's/\{[^\}]+\}//g' -e 's/[[:space:]]$//g' -e 's/[[:space:]]+/\n/g' | \
    awk -F ":" '{print "tmsh list gtm server",$1,"virtual-servers \{",$2,"\}"}' 2>/dev/null | bash +x | awk '/destination/ {print $2}'
    10.131.131.142:http
    10.131.131.141:http