Forum Discussion
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.
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