shutdown -h now HOSTALL

There's a power outage scheduled for our server room tomorrow night (which means I'm gonna miss the VanBrewers meeting, BOO HISS). I've been looking for a way to script the shutdown and startup of 50-odd servers, and here's what I've come up with.

Previously I've been using cssh, which works well enough for shutdown but not so well for startup (long story). Still, SSH is the way I want to go, so I looked at pssh and sshpt, but was unable to get both to work with a pseudo-tty to allow sudo. Then I came across Fab, and with a little bit of reading and a little bit of code I came up with something that should work.

Of course, the real problem is that I'm hand-coding so much of it: this server is HP and should be shut down like this, that server is Sun and should be shut down like so...really, I should be using ipmitool to do all this. But the mgt network is on a private subnet, I'm somewhere else, and this is the simplest quick thing I could do. We'll see how it goes.

(This half-assed blog entry brought to you by cold medication and a sinus infection. Whee!)