dsh: dancer's shell gives you power over multiple Macs
This month's MacTech magazine offers a feature article by Edward Marczak on using dsh, the "dancer's shell" or distributed shell utility, to batch-administer machines in a single blast without having to hit each one, or use a pricey management tool such as ARD or LANrev. Although dsh isn't included with Mac OS X or available as a binary or port build, it does compile cleanly on the Mac and should work well out of the box.The idea behind dsh is to take a list of targets (machines you can reach via SSH), and run a command or extended script on all of them at once. This is functionality that's wrapped up in a nice GUI in Apple Remote Desktop; it's deeply powerful and very handy. Supposing you wanted to check the uptime for a bunch of your lab boxes -- manually, you'd have to run around, or SSH to each one and run the 'uptime' command. With dsh, you make your machine list (optionally, loading your SSH public key on the machines ahead of time to avoid password prompts) and run one command:
dsh -Ma uptimeVery handy. The full article isn't online yet, but it's worth seeking out a copy of the magazine if you're interested in automation of enterprise Mac admin tasks.
Share
Categories
This month's MacTech magazine offers a feature article by Edward Marczak on using dsh, the "dancer's shell" or distributed shell utility,...
Add a Comment
There is a feature in iTerm that lets you send commands to multiple windows. I like it because I can chain a tail -f of the log after the command and check each host to make sure nothing went wonkey.
January 14 2008 at 11:54 AM Report abuse Permalink rate up rate down ReplyI was going to suggest looking to see if fink has a package, but oops, looks like Godaddy's parked the domain name now. sad :(
January 12 2008 at 3:27 AM Report abuse Permalink rate up rate down Replyoh, hah: "Fink Is Not Kaput ;)"
http://www.racoonfink.com/archives/000752.html
There is also pdsh, for running it in parallel
January 12 2008 at 12:45 AM Report abuse Permalink rate up rate down Replyyeah I built a very robust perl script that does this with many very nice options about 2.5 years ago. I update it and add features frequently so it's become quite a nice tool.
This is a definite need for many admins tho so kudos!
I made a kind of similar tool at my work on my mac (and linux of course)
it uses texts lists but also LDAP to get list of computers to ssh-execute the command.
for example, I can ask "all machines in the room 305" and it uses ldap to know what are the ip of the computer in the 305 room.
I made also little scripts and a website (for admins colleagues) to manage my custom directory of computers.
What is the port name? 'sudo install port dsh' doesn't seem to work
January 11 2008 at 4:14 PM Report abuse Permalink rate up rate down ReplySire, I said it's NOT in Macports. Sorry, you'll need to compile from source... :-)
January 11 2008 at 4:32 PM Report abuse Permalink rate up rate down ReplyWell, cool idea. "But" we've been doing that already for some time thanks to the Ruby on Rails deployment tool "Capistrano". One of its feature is exactly a command line "cap shell" that allows us to run shell commands in multiple machines (and check its output). It also uses ssh, by the way.
January 11 2008 at 3:55 PM Report abuse Permalink rate up rate down ReplyI used dsh a lot when I was administering a beowulf cluster. Glad to hear that it's working on the Mac. Here's a quick tip: set up a public/private keypair within ssh for the user you're planning to use, and make sure you can ssh over with no password prompt before trying to use dsh. Typing the password over and over again is no fun.
January 11 2008 at 3:22 PM Report abuse Permalink rate up rate down ReplyInteresting. I have a primitive version myself, basically just a wrapper on "for host in ...; do ssh $host $*; done". I called it "blast". I'll have to give this a try.
January 11 2008 at 2:32 PM Report abuse Permalink rate up rate down ReplyLet us know how it goes. Interesting challenge is doing tasks that require admin access on the remote host, as it's hard to pass a sudo password through (at least it was for me).
January 11 2008 at 2:39 PM Report abuse Permalink rate up rate down ReplyHot Apps on TUAW
Deals of the Day
more deals- Altec Lansing Octiv Duo iDock for $48 + free shipping
- Used Apple iMac 17" Core Duo 1.83GHz for $430 + $28 s&h
- Lounge Deluxe Stand for iPhone / iPod touch for $28 + $8 s&h
- Brookstone Surround-Sound Earbuds for $14 + $7 s&h
- Refurbished Skullcandy Tokidoki Smokin' Buds Mic'd Headset for $5 + $2 s&h
- Stitchway Backup Battery for iPod / iPhone for $5 + free shipping
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



12 Comments