Forum Discussion
David__Pasch
Jun 26, 2019Altostratus
TMSH equivalent command for virtual count
Version 11-13. Guys, I am looking for a command similar to "tmsh list one-line | wc -l" thank I can run IN the tmsh shell. or any command that will clearly give me a count of victua...
- Jun 26, 2019
Hi
Have you tried grep -c from tmsh to count the number of matches. So something like
list ltm virtual | grep -c "ltm virtual"
jaikumar_f5
Jun 26, 2019MVP
Would this help your need, put the below ones in the a simple bash script and execute them. Would look clean output 🙂
~ # echo -n "Total Virtual Servers : " ; tmsh show ltm virtual | grep -c Availability
~ # echo -n "Virtual Servers Available : " ; tmsh show ltm virtual | grep -c "Availability : available"
~ # echo -n "Virtual Servers Unavailable : " ; tmsh show ltm virtual | grep -c "Availability : unavailable"
~ # echo -n "Virtual Servers Offline : " ; tmsh show ltm virtual | grep -c "Availability : offline"
~ # echo -n "Virtual Servers Unknown : " ; tmsh show ltm virtual | grep -c "Availability : unknown"
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