Parallel SSH is a useful tool designed to run a command on multiple servers in parallel. An advantage of PSSH over some alternatives (like DSH) is the manner outputs are stored: all outputs are sent to a folder containing an output file per server.
Using PSSH
First create your servers list, using the syntax host:port user
:
vi /tmp/hosts_list.txt
server1
server2
server3:2222 foobar
Then create two directories: one for standard outputs, the second for error outputs.
mkdir /tmp/output
mkdir /tmp/error
Then execute your command:
parallel-ssh -h /tmp/hosts_list.txt -o /tmp/output/ -e /tmp/error/ uptime
Further Reading and sources
- http://code.google.com/p/parallel-ssh
man parallel-ssh