Difference between revisions of "HiveSSH"

From Noah.org
Jump to navigationJump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Engineering]]
 
[[Category:Engineering]]
 +
[[Category:beta]]
 
[[Category:Free_Software]]
 
[[Category:Free_Software]]
 +
== Control a group of hosts from one shell ==
  
== Control a group of hosts from one shell ==
+
This lets you SSH to a group of servers and control them as if they were one. Each command you enter is run on each host in parallel. The response of each host is collected and printed. In normal synchronous mode Hive will wait for each host to return the shell command line prompt. The shell prompt is used to sync output.
  
This lets you SSH to a group of servers and control them as if they were one.
+
The goal of this tool is similar to `cssh` (Cluster SSH), but `cssh` runs in X Windows and is much nicer. HiveSSH is a text application that runs in a terminal.
Each command you enter is run on each host in parallel. The response of each
 
host is collected and printed. In normal synchronous mode Hive will wait for
 
each host to return the shell command line prompt. The shell prompt is used
 
to synch output.
 
  
 
=== Download ===
 
=== Download ===
Download the from here:
+
 
 +
HiveSSH is one of the example application that comes with Pexpect. Download from here:
 
     [http://sourceforge.net/project/showfiles.php?group_id=59762 SourceForge]
 
     [http://sourceforge.net/project/showfiles.php?group_id=59762 SourceForge]
  
Line 17: Line 16:
  
 
=== Notes ===
 
=== Notes ===
This is a stable beta. I plan to improve the user interface.
+
This is a stable beta. I might get rid of the synchronous mode so that hosts can respond in their own time. Another idea is to build a curses interface so that you can sequence through all the different host output screens.
I might get rid of the synchronous mode so that hosts can
 
repond in their own time. Another idea is to build a curses interface
 
so that you can sequence through all the different host output screens.
 
  
 
=== Example ===
 
=== Example ===
  
 
This shows hivessh connecting to two servers and running uptime.
 
This shows hivessh connecting to two servers and running uptime.
 +
 
<pre>
 
<pre>
 
     $ ./hivessh.py host1.example.com host2.example.net
 
     $ ./hivessh.py host1.example.com host2.example.net
Line 45: Line 42:
 
     =======================================================================
 
     =======================================================================
 
</pre>
 
</pre>
 +
 
Usage:
 
Usage:
 +
 
<pre>
 
<pre>
 
     hivessh.py host1 host2 host3 ... hostN
 
     hivessh.py host1 host2 host3 ... hostN
 
</pre>
 
</pre>
 +
 
You will be asked for your username and password.
 
You will be asked for your username and password.
 
It is assumed that these will be the same for all hosts
 
It is assumed that these will be the same for all hosts

Latest revision as of 12:07, 16 August 2008

Control a group of hosts from one shell

This lets you SSH to a group of servers and control them as if they were one. Each command you enter is run on each host in parallel. The response of each host is collected and printed. In normal synchronous mode Hive will wait for each host to return the shell command line prompt. The shell prompt is used to sync output.

The goal of this tool is similar to `cssh` (Cluster SSH), but `cssh` runs in X Windows and is much nicer. HiveSSH is a text application that runs in a terminal.

Download

HiveSSH is one of the example application that comes with Pexpect. Download from here:

   SourceForge


Notes

This is a stable beta. I might get rid of the synchronous mode so that hosts can respond in their own time. Another idea is to build a curses interface so that you can sequence through all the different host output screens.

Example

This shows hivessh connecting to two servers and running uptime.

    $ ./hivessh.py host1.example.com host2.example.net
    username: noah
    password: 
    connecting to host1.example.com - OK
    connecting to host2.example.net- OK
    targetting hosts: 192.168.1.1 192.168.1.2 
    CMD (? for help) > uptime
    =======================================================================
    host1.example.com
    -----------------------------------------------------------------------
    uptime
    23:49:55 up 74 days,  5:14,  2 users,  load average: 0.15, 0.05, 0.01
    =======================================================================
    host2.example.net
    -----------------------------------------------------------------------
    uptime
    23:53:02 up 1 day, 13:36,  2 users,  load average: 0.50, 0.40, 0.46
    =======================================================================

Usage:

    hivessh.py host1 host2 host3 ... hostN

You will be asked for your username and password. It is assumed that these will be the same for all hosts or that you have key pairs registered for each host.

   --askall : This tells Hive that you want to be prompted for your
               username and password separately for all machines.
               This is useful if you have differnet usernames and
               passwords on each host. This can even be used to connect
               to different user accounts on a single host. For example:
                   hive.py --askall host1 host1 host1