Forum Discussion
Sam_Hall
Nov 29, 2013Nimbostratus
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 mon...
Aug 05, 2021
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
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects