05-Aug-2021
01:36
- last edited on
04-Jun-2023
19:21
by
JimmyPackets
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'
Solved! Go to Solution.
06-Sep-2021
00:31
- last edited on
04-Jun-2023
19:18
by
JimmyPackets
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.
06-Sep-2021
00:31
- last edited on
04-Jun-2023
19:18
by
JimmyPackets
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.
06-Sep-2021 13:59
Hi Dario, thanks. +1