csshX – Cluster SSH tool using MacOS-X Terminal.app

2009-02-11 (Wed)

One of the all time great sysadmin tools is Cluster SSH. It allows you to open up ssh sessions on multiple machines and send commands to them all through a common master window. It’s a perl script that uses xTerms and Tk.

My problem was that OS-X has a bit half-hearted X11 support and I always wanted a version that used Terminal.app. Finally after messing with some Applescript the other day, I realised it is possible to do.

So I have created csshX – my OS-X homage to cssh.

csshX is pure Perl (with calls to AppleScript) and should run on any 10.4 or 10.5 machine.

One known issue is that if you change focus, while csshX is opening many windows, it may capture the wrong terminal window. This is because there seems to be no good way to capture a handle to a Terminal window while you are opening it (I have to grab a handle to the front-most window after it has opened).

Let me know if you find csshX usefull, or you have any good ideas about how I could improve it.

Tags:

10 Responses to “csshX – Cluster SSH tool using MacOS-X Terminal.app”

  1. snovotny Says:

    i was just thinking about this!

    thx.

  2. 1esproc Says:

    Thanks for this, perfect timing! I’d like to file a minor bug report though ;) There is a typo in the title of the master Terminal window, it reads “connetions”, not “connections”

  3. brockgr Says:

    1esproc – thanks for that – I fixed it in the code base (which is moving to Google Code – http://code.google.com/p/csshx/)


  4. [...] During a reading session online, I came across the following post on cluster SSH. Very nice when connecting to multiple machines to do common work. I can image the [...]

  5. Boyd Adamson Says:

    I just discovered this tool and it’s saved my life for a task I had this week. Thanks!

    I do have one, rather esoteric, feature request. It would be nice to be able to identify sets of machines within the open windows and toggle the enabled-ness of a whole set at a time.

  6. brockgr Says:

    Boyd, Glad it’s come in handy.

    Regarding the feature, I sort of see where you are coming from, but how would you want select a “set” of machines. I know their hostnames when you opened them so could use that – some kind of pattern match?

    Feel free to open a feature request at: http://code.google.com/p/csshx/issues/list (so I don’t forget about it)…

  7. Ido Says:

    Great Tool!
    Any options to change the ssh port?

    • brockgr Says:

      Ido..

      Firstly, make sure you have the latest version http://csshx.googlecode.com/files/csshX-0.63.tgz (0.62 and earlier had some bug with ports).

      You should be able to just call:
      csshX hostname:1234

      Another option is to code the ports in your .ssh/config:
      Host hostname
      Port 1234

      The latter has the advantage of working in all ssh based programs, eg csshX, scp, sftp etc.

      Hope this helps….

  8. Ido Says:

    yep – both works.
    Thanks!!


Leave a Reply