Hydrashell, a tool for working on multiple Unix hosts

A few years ago ago, I was in a class for Veritas Cluster Server, and a cluster shell tool was mentioned. It wasn't set up on the lab hosts, but I thought, "how hard could that be?" And the answer is: not hard at all.

I present to you hydrashell, a tool for working on multiple Unix hosts at once. It's still pretty primitive and probably always will be, but I already find it useful for working on multiple Unix hosts at once. I am of course hardly the first or only person to write something like this, but mine is nice and general-purpose - for one thing, it requires nothing more than bash and ssh, not even Perl or Python. Hydrashell presents you with a prompt, and when you type a command, that command gets run on every system you've defined. It also has the nice feature that it keeps a command history like your login shell! It looks something like this:

workstation:~$ ./hy server1 server2
hy> uptime
----{ server1 }--------------------
  02:31PM   up 16 days,  23:10,  1 user,  load average: 0.00, 0.00, 0.00
----{ server2 }--------------------
  02:31PM   up 13 days,  22:04,  1 user,  load average: 0.00, 0.01, 0.01

You can run commands on the local system by using "+" as an escape character to prefix the command (like this: +ls -l) or do other things like define the host list on the command line, change it during your session, set headers to display or not, etc. Hydrashell doesn't mess with your terminal or your $PATH in any way, so interactive commands like vi will still work just fine when invoked like +vi myfile. Do +hylist to see your host list, or +hyhosts to define a new one, or a bunch of other things (like quit with +quit). +hyhelp will show you the list of commands, like this:

hy> +hyhelp
Available escape-commands:
hyadd: add a host to the host list
hycolor: toggles color usage
hyget: get a file from the remote system
hyheaders: toggles hostname printing
hyhelp: prints available commands
hyhosts: sets host list
hylist: displays host list
hyput: put a file to the remote system
quit: exits hydrashell

Hydrashell also supports a .hydrashell file in your home directory so you can save your preferred settings. It is strongly suggested that you have passwordless ssh set up...otherwise you will get very tired of typing in your password very fast. Alternately, you can do something with OpenSSH's ControlMaster option - ControlPersist looks like it might be very handy even if for whatever reason you can't set up passwordless ssh.

To try it out, just download hydrashell.tar.gz and away you go! It has some minor limitations, some due to the way it works and some due to the fact that it's still pretty beta, but if you're not a command-line sort of guy, you probably don't want this anyway, and if you are, you'll probably be able to deal with it.

Similar (usually more polished) software includes:


Updated Mon Apr 2 2012