Forum Discussion

pjcampbell_7243's avatar
Jan 26, 2017

Historical connections per virtual server?

Is there any way to get historical data of the number of active connections per virtual server? I'd like to be able to graph this data. The only way I Can think of doing this currently would be to ssh in and do something like:

 

tmsh show ltm virtual VS_NAME_HERE |grep "Current Connections"|awk '{print $3}'

 

Which I'm sure is not very efficient but I think it would be effective. Is there a built in ability to do this?

 

4 Replies

  • What about using one of the mibs to monitor this via SNMP? Does anyone know which is the correct mib?

     

  • My - a little bit more automated version - sh one liner - maybe not efficient because it executes tmsh 2x but works pretty fast and it's vs-name-independent :)

     

    for i in $(tmsh show ltm virtual | grep -P 'Ltm::Virtual Server' | cut -d ':' -f 4);do echo -ne "$i\t";tmsh show ltm virtual $i|grep 'Current Connections'|awk '/Current Connections/ {print $1 " " $2 " = " $3}';done

     

    Thanks for providing link (SNMP) - I'm also trying to graph sessions per VS.

     

    • Michal_Cz__1936's avatar
      Michal_Cz__1936
      Icon for Nimbostratus rankNimbostratus

      How to get OIDs for Current connections per VS... I've automated this a little bit. It's fast and easy to use. Just put below code to file.sh , chmod +x file.sh and exectue. Now you can use this OIDs to get counter value per VS. If you want different counter from VS - simply change ent value. The simplest way to get OID names is to get it via GUI. Then unpack file mibs_f5.tar and check file F5-BIGIP-LOCAL-MIB.txt

      ent="F5-BIGIP-LOCAL-MIB::ltmVirtualServStatClientCurConns."
      while read vs
      do
          len=${vs}
          grep -o . <<< $vs | (while read vs; do l=$(printf ".%d" "'$vs");vsoid=$vsoid$l;done;    
          echo "$ent$len$vsoid")
      done< <(grep 'ltm virtual ' bigip.conf | cut -d ' ' -f 3)
      

      Then check if OIDs works 🙂

      $1

      Hope this helps 🙂

      Thanks again for providing link how to get oid of particular VS!

      Regards, Michal