AMG: As its name implies, multissh ssh'es to multiple hosts for the purpose of executing commands. This all by itself is a very trivial task, but the fun begins when you start to consider what to do with stdin, stdout, and stderr. multissh takes all input received on stdin and sends it to all remote hosts; all stdout and stderr text from the remote hosts is piped to the local stdout and stderr, with the hostname prepended.
Perhaps an example will help. Here's a "screenshot":
[root@utanium|~]# multissh "localhost bravo charlie" uptime localhost: 17:51:49 up 4:52, 2 users, load average: 0.00, 0.00, 0.00 bravo: 17:50:52 up 2:29, 1 user, load average: 0.00, 0.00, 0.00 charlie: 17:51:05 up 2:27, 1 user, load average: 0.00, 0.00, 0.00 [root@utanium|~]#
Well, there you have it. Now for stdin handling:
[root@utanium|~]# multissh "localhost bravo charlie" "cat > file" illustrative verbiage [root@utanium|~]# multissh "localhost bravo charlie" "cat < file" localhost: illustrative verbiage bravo: illustrative verbiage charlie: illustrative verbiage [root@utanium|~]# multissh "localhost bravo charlie" "rm file" [root@utanium|~]#
Amazing, really. stderr works too:
[root@utanium|~]# multissh "localhost bravo charlie" "rm file" localhost: rm: cannot remove `file': No such file or directory charlie: rm: cannot remove `file': No such file or directory bravo: rm: cannot remove `file': No such file or directory [root@utanium|~]#
Although not very well. :^) I don't get access to stderr until I [close] the ssh channels.
Anyways, download your free copy today and have a lot of fun.
What: multissh Where: http://ioioio.net/devel/multissh/ Description: Runs commands on multiple remote hosts simultaneously. Version: 0.1 Updated: 21 September 2005 License: GPL 2.0 or later Contact: Andy Goth <[email protected]>