28-Nov-2013 17:20
Using a one liner from the terminal or otherwise perhaps there's a way to do this with iControl, I'm looking to get the number of offline virtual servers.
I'm trying to come up with a way of monitoring the F5 to detect when any site(s) go down. The offline column listed in the GUI: "Statistics >> Module Statistics : Local Traffic" looks good. How do I tap into those stats?
29-Nov-2013
00:03
- last edited on
01-Jun-2023
11:20
by
JimmyPackets
Hi,
I didn't find any "directs" commands to do it.
But what I can suggest you is :tmsh show ltm virtual | grep offline | wc -l
You have to run this command from bash.
05-Aug-2021
01:11
- last edited on
04-Jun-2023
19:21
by
JimmyPackets
Hi,
the following one-liner gives you a list of all virtual servers and their current availability states:
tmsh -q -c 'cd /;show ltm virtual recursive' | grep -iE '(ltm::virtual|availability)' | sed ':a;N;s/\n/ /' | sed -r 's/ltm::virtual server *:? *//I; s/ *availability *:? */ /I'
Now you can filter on the specific availability state you are looking for and count the lines:
tmsh -q -c 'cd /;show ltm virtual recursive' | grep -iE '(ltm::virtual|availability)' | sed ':a;N;s/\n/ /' | sed -r 's/ltm::virtual server *:? *//I; s/ *availability *:? */ /I' | grep -i offline | wc -l