[Testing] ssh-controlled testbeds with dsh
Gary C Martin
gary at garycmartin.com
Sat Nov 8 00:24:27 EST 2008
On 7 Nov 2008, at 23:57, Mel Chua wrote:
> Following up on Gary's emails and Michael's suggestion from last
> week, I was playing around this morning with...
> ...and life looks pretty glorious.
> Why is this cool? Well, say you wanted to run the ps command on all
> the machines in your /etc/dsh/machines file, which looks like this...
> olpc at 188.8.131.52
> olpc at 184.108.40.206
> All you have to do is this:
> mchua at tumtum-tree:~$ dsh -Mac ps
> And you'll get this.
> olpc at 220.127.116.11: PID TTY TIME CMD
> olpc at 18.104.22.168: 1166 ? 00:00:00 startx
> olpc at 22.214.171.124: 1185 ? 00:00:00 xinit
> olpc at 126.96.36.199: 1211 ? 00:00:02 ck-xinit-sessio
> <...more entries from 188.8.131.52 go here>
> olpc at 184.108.40.206: PID TTY TIME CMD
> olpc at 220.127.116.11: 1549 ? 00:00:00 startx
> olpc at 18.104.22.168: 1566 ? 00:00:00 xinit
> olpc at 22.214.171.124: 1577 ? 00:01:31 python
> <...more entries from 126.96.36.199 go here>
> To answer Gary's previous question, we're trying to do the third
> option - option 2 as a special case of option 1. The example on the
> dsh wikipage is a good simple example (running ps).
>> 1). Want to run some admin script on every XO. Perhaps you want to
>> wipe the datastore and reboot, perhaps you want to trigger suspend
>> and use administration ping to wake them up again repeatedly, etc.
>> 2). Want to collect a set of data from every XO and look for
>> anomalies/failures. This could be lists of buddies each is
>> currently seeing, or AP each is seeing, cpu loads, free memory,
>> dropped packets, packet collisions, etc.
>> You could see option 2 as a specific case of option 1, where you
>> write a nice batch that collects and cleanly reformats all the
>> spurious outputs you get from the various tools.
I've updated the below wiki page with some of the bash tricks/scripts
I've been using. No 3rd party tools needed, all it assumes is that
you've made a public/private key pair and copied the public key over
to all the XOs to automate authentication:
The last example there shows a slightly more complicated script
collecting a bunch of nicely formatted data for each XO. If you can
tell me the numbers/fields you actually want to collect, I could make
that a more useful script for you...
More information about the Testing