Forum Discussion

gdoyle's avatar
gdoyle
Icon for Cirrostratus rankCirrostratus
Feb 20, 2018

CLI command to see load balancing method for all Virtual Servers?

Is there a command in CLI I can use to display the load balancing method for all virtual servers?

 

Thanks.

 

  • Load balancing method is a pool setting. You can check it with

     tmsh list ltm pool pool_name load-balancing-mode
    

    You can run an small script for getting vs-pool relation and then get load balancing method

    ! /bin/bash 
    output=$(tmsh list ltm virtual |grep "ltm virtual" | awk -F" " '{ print $3 }') 
    for LINE in ${output}; do
      pool=$(tmsh list ltm virtual ${LINE} pool |grep pool |awk -F" " '{ print $2 }')
      if [ $pool != none ]
      then
         echo "Virtual: ${LINE}:"
         tmsh list ltm pool $pool load-balancing-mode
     fi
     done