cancel
Showing results for 
Search instead for 
Did you mean: 

tmsh command to filter VIP with "current connection" count

Macaron
Altostratus
Altostratus

Hi Everyone,

I am trying to make a list of VIP in our inventory having "current connection". I currently doing it manually through GUI by navigating to VIP statistics and looking for VIPs having current connections. This is very time consuming.

 

I was wondering if there is a tmsh one line command that i can use for this purpose which will return all VIP having current connections?

 

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

Rob_Stonham
Cirrus
Cirrus

Does this work for you?

It shows a list of all virtual servers with a current client side connection count of greater than 0.

tmsh -q -c "cd / ; show /ltm virtual recursive field-fmt" | grep "ltm\ virtual\|clientside.cur-conns" | awk '/clientside.cur-conns\ [1-9]/ { print $2, a}{a=$3}'

or if you want all virtual servers ordered by number of current connections

tmsh -q -c "cd / ; show /ltm virtual recursive field-fmt" | grep "ltm\ virtual\|clientside.cur-conns" | awk '/clientside.cur-conns/ { print $2, a}{a=$3}' | sort -n

 

If you really want the IP address, you can replace "virtual" with "virtual-address" in the commands above to get the VIP instead of the virtual server name displayed

Rob

 

View solution in original post

2 REPLIES 2

Rob_Stonham
Cirrus
Cirrus

Does this work for you?

It shows a list of all virtual servers with a current client side connection count of greater than 0.

tmsh -q -c "cd / ; show /ltm virtual recursive field-fmt" | grep "ltm\ virtual\|clientside.cur-conns" | awk '/clientside.cur-conns\ [1-9]/ { print $2, a}{a=$3}'

or if you want all virtual servers ordered by number of current connections

tmsh -q -c "cd / ; show /ltm virtual recursive field-fmt" | grep "ltm\ virtual\|clientside.cur-conns" | awk '/clientside.cur-conns/ { print $2, a}{a=$3}' | sort -n

 

If you really want the IP address, you can replace "virtual" with "virtual-address" in the commands above to get the VIP instead of the virtual server name displayed

Rob

 

Thank you so much. It worked as expected. Also, I am trying to build these filters my self would you be to able give me a head start?