Multi SSH (MuSSH)

Recently I ran into a situation where I needed to run a command on a large number of servers. There are existing libraries out there, but I found that they wouldnt run under OS X for one reason or another, or they didnt handle a large number of servers very well. Normally I do this with something along the lines of

And while the above does work it suffers from being a big loop. It connects to a server, runs the command, disconnects, and connects to the next and so on.

 

I ended up putting something together in ruby which can either take a comma delimited list on the command line or read from a file if you have a large number of hosts or happen to use the same hosts often

You can see the latest code here on github.