pssh - parallel ssh

Since I deal with hundreds of servers at work, I found this handy little Python application out there called Parallel SSH:

http://www.theether.org/pssh/
http://code.google.com/p/parallel-ssh/

This allows me to create a file that holds my server lists, that looks like this:

vi hosts.txt

server1.domain.com
server2.domain.com
server3.domain.com
server4.domain.com

 

Then, I can run the exact same SSH command on all those servers, by running one command like this:

pssh -h hosts.txt -l root -i "df -h"

I'll then, very quickly, be able to tell how much free space I have on all my servers.  Very handy !

 

For some reason, the version installed on my Ubuntu Karmic laptop, does not give the common launchers of pssh, pscp, etc.  Also, the version installed is the older 1.43 instead of the current 2.0.  So, no biggie, I decided to just package it up myself.  The source used a Python script called ez_setup.py, but after a little Googling, I found the way to get it to install correctly.  I even created a Ubuntu Jaunty version of it, just in case that's needed.

sudo add-apt-repository ppa:thelupine/ppa
sudo apt-get update
sudo apt-get install pssh