cancel
Showing results for 
Search instead for 
Did you mean: 

List LTM virtual server availability states

The following one-liner lists the availability states of all virtual servers on your BIG-IP LTM device.

The recursive show command followed by a grep filters the relevant lines from the virtual server statistics.

The first sed statement joins the lines with containing the virtual server name and its current availability state.

The second sed statement removes unnecessary information.

 

tmsh -q -c 'cd /;show ltm virtual recursive' | \ grep -iE '(ltm::virtual|availability)' | \ sed ':a;N;s/\n/ /' | \ sed -r 's/ltm::virtual server\s*:?\s*/\//I; s/\s*availability\s*:\s*/ /I'
1 ACCEPTED SOLUTION

Hello Stephan.

 

It's slighty easier to get this info with Awk.

tmsh -q -c 'cd /; show ltm virtual recursive' | awk '/Ltm::Virtual/ {printf $3" "} /Availability/ {printf $3"\n"}' | column -t

 

Regards,

Dario.

Regards,
Dario.

View solution in original post

2 REPLIES 2

Hello Stephan.

 

It's slighty easier to get this info with Awk.

tmsh -q -c 'cd /; show ltm virtual recursive' | awk '/Ltm::Virtual/ {printf $3" "} /Availability/ {printf $3"\n"}' | column -t

 

Regards,

Dario.

Regards,
Dario.

Hi Dario, thanks. +1