Forum Discussion
Looking for a way to pull offline virtual server statistics from F5 LTM
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?
2 Replies
- Thomas_Gobet
Nimbostratus
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 -lYou have to run this command from bash.
- StephanManthey
Nacreous
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com