Forum Discussion
Running tmsh commands on multiple devices at once
Prerequisite: You will need a box that can ssh to all of your devices. "Pivot box" or "Jump box"
--Using CLI via F5 box or *Nix box
Shown below on a Version 9 box: Show me: hostname and kernel version and BIGIP version
&& - Will execute the command whether the previous command completed successfully.
while read HOST ; do echo "" | ssh $HOST "uname -a && date && echo -en '\n' && b version show | head -6 | sed 's/Final*//'" ; done < f5hosts.txt
f5hosts.txt --a list of all of the boxes you want to run tmsh commands, by hostname or IP
in between the quotes you list out the tmos commands. ie. "tmostcommand && tmostcommand && tmoscommand"
while read HOST ; do echo "" | ssh $HOST "tmostcommand && tmostcommand && tmoscommand" ; done < f5hosts.txt
Example:
while read HOST ; do echo "" | ssh $HOST "tmsh show ltm persistence persist-records && tmsh show ltm nat all && show sys hardware " ; done < f5hosts.txt
If you prefer you can pipe everything out to a file.
while read HOST ; do echo "" | ssh $HOST "tmsh show ltm persistence persist-records && tmsh show ltm nat all && show sys hardware " ; done < f5hosts.txt
> output.txtRecent 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