App-ClusterSSH

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

- Fix test error on 5.8.8 (reported by Wei Wang)
- Added '--list', '-L' to list available cluster tags (idea from Markus Manzke)
- Fix terminal size only set on last windows (Sf bug 3061999)
- Added '--use_all_a_records' (Simon Fraser)

4.00_05 2010-06-20 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Tidy up pod for whatis errors
- Amend copyright years and text to be consistent
- Include missing buld prereq (Test::Trap)
- Correct '--font, -f' in cssh documentation
- Thanks to Tony Mancill for reporting these errors

4.00_04 2010-06-20 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Update MANIFEST file to ensure all correct files are included in release

4.00_03 2010-06-20 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Fix silly type in code/tests

4.00_02 2010-06-19 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Add in bugtracker and homepage resources to Build.PL file
- Bring new module App::ClusterSSH::Host into play for parsing host strings
- Patch to override font used on command line (Roland Rosenfeld)
- Put options in cssh pod into alphabetical order

4.00_01 2010-01-08 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Remove GNU tools and switch to Perl module layout using Module::Build

3.29 0000-00-00 Duncan Ferguson <duncan_ferguson@user.sf.net> (unreleased)

- Handle hostnames containing % properly (Debian bug  543368)
- Thanks to Tony Mancill for the patch

Changes  view on Meta::CPAN


- Apply bugfix supplied by Jima
- Ensure loading of hosts from user ssh config file is case insensitive

3.22_1 2008-01-23 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Update X resources class to allow use of terms other than XTerm
- Apply patch from Harald Weidner to stop error messages in Debian Etch
- Add in key shortcut (alt-h) to toggle history window
- Tidy up pod a little to highlight notes better
- Check terminal_font config for quotes and remove
- Enable use of "configure --sysconfdir=", defaults to /etc
- Revise host checking algorithm to take ssh_config files into account
- Revise username check used as part of host id to accept more chars
- Correct year value for previous two entries from 2008 to 2007

3.21_1 2007-11-28 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Implement a basic history window in the console (option -s)
- Fixed bug whereby username@ wasn't being used correctly

Changes  view on Meta::CPAN

- Run through perltidy -b -i=2
- Appy patches from Klaus Ethgen
- Client dies when cannot write to pipe
- Sleeping and flushing in window manager to allow time to draw windows
- Fix pipe reading to not use undefined values
- Apply patches from Nicolas Simonds
- allow colons in hostnames
- allow -o option as per man page
- Apply patch from Peter Palfrader
- improvement to finding binaries
- Allow font to be specified on the command line
- Check for errors around key data gathering
- Add in 'extra_cluster_file' to csshrc

3.19.1_1 2006-07-24 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Below is an abridged version of changes - see CVS for more information
- Check for failure to connect to X session
- Totally rework character mapping and events to cope with non-QWERTY keyboards
- Rework pasting code to cope with non-QWERTY charatcters
- Manpage/help doc updates and corrections

Changes  view on Meta::CPAN

- Marked version number with 3rd digit to signify beta releases

3.11 2005-05-18 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Remove trailing whitespace from config file lines
- Prevent paste events being sent to non-active clients
- Allow paste events to send capitalised letters

3.10 2005-05-17 Duncan Ferguson <duncan_ferguson@user.sf.net>

- fix for moving atom numbers in font info

3.9 2005-05-11 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Allow multiple hosts or tags in the "Add Host" text widget
- Retile all windows (if set) after adding a host
- Do not automatically send a return after hostname (Alt-n)
- Fix bug with sending read hostname instead of internal unique host 
  name (Alt-n)
- Fix bug whereby cannot start cssh without any hosts on cmd-line
- Fix bug where client name was sent to inactive clients
- Fix bug whereby 0's in sent text were ignored

3.8 2005-05-09 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Remove the need for xlsfonts (perform function by X window calls instead)
- Debug level output changes
- Ensure windows are overlapping in the right places, instead of any order
- Create config section on window decorations (i.e. title & scroll bars)

3.7 2005-05-05 Duncan Ferguson <duncan_ferguson@user.sf.net>

- Found ConfigureWindow instead of ResizeMoveWindow

3.6 2005-05-05 Duncan Ferguson <duncan_ferguson@user.sf.net>

README  view on Meta::CPAN

NAME
    cssh - Cluster administration tool

VERSION
    This documentation is for version: 4.13.2

SYNOPSIS
    cssh [-a '<command>'] [-K <seconds>] [-q] [-c '<filename>'] [-x <cols>]
    [-C '<filename>'] [--debug [[...] || <INTEGER>]] [-d] [-e
    '<[user@]<host>[:port]>'] [--fillscreen] [-f '<font>'] [-h] [-L '[tag]']
    [-H] [-o '<STRING>'] [-p <port>] [-Q] [-y <rows>] [-s] [-r '<filename>']
    [-t '<STRING>'] [-g] [-T '<title>'] [-u] [-?] [-A] [-l '<username>']
    [-v]

DESCRIPTION
    The command opens an administration console and an xterm to all
    specified hosts. Any text typed into the administration console is
    replicated to all windows. All windows may also be typed into directly.

    This tool is intended for (but not limited to) cluster administration

README  view on Meta::CPAN

        $HOME/.clusterssh/config file.

    --evaluate '<[user@]<host>[:port]>', -e '<[user@]<host>[:port]>'
        Display and evaluate the terminal and connection arguments to
        display any potential errors. The <hostname> is required to aid the
        evaluation.

    --fillscreen
        Resize terminal windows to fill the whole available screen

    --font '<font>', -f '<font>'
        Specify the font to use in the terminal windows. Use standard X font
        notation such as "5x8".

    --help, -h
        Show basic help text and exit

    --list '[tag]', -L '[tag]'
        List available cluster tags. Tag is optional. If a tag is provided
        then hosts for that tag are listed. NOTE: format of output changes
        when using "--quiet" or "-Q" option.

README  view on Meta::CPAN


        terminal_chdir = 0
            When non-0, set the working directory for each terminal as per
            'terminal_chdir_path'

        terminal_chdir_path = $HOME/.clusterssh/work/%s
            Path to use as working directory for each terminal when
            'terminal_chdir' is enabled. The path provided is passed through
            the macro parser (see the section above on 'macros_enabled'.

        terminal_font = 6x13
            Font to use in the terminal windows. Use standard X font
            notation.

        terminal_reserve_top = 5
        terminal_reserve_bottom = 0
        terminal_reserve_left = 5
        terminal_reserve_right = 0
            Number of pixels from the terminal's side to reserve when
            calculating screen geometry for tiling. Setting these will help
            keep cssh from positioning windows over your scroll and title
            bars or otherwise overlapping the windows too much.

lib/App/ClusterSSH.pm  view on Meta::CPAN


            my $exec = join( ' ',
                $self->config->{terminal},
                $color,
                $self->config->{terminal_args},
                $self->config->{terminal_allow_send_events},
                $self->config->{terminal_title_opt},
                "'"
                    . $self->config->{title} . ': '
                    . $servers{$server}{connect_string} . "'",
                '-font ' . $self->config->{terminal_font},
                "-e " . $^X . ' -e ',
                "'" . $self->helper->script( $self->config ) . "'",
                " " . $servers{$server}{pipenm},
                " " . $servers{$server}{givenname},
                " '" . $servers{$server}{username} . "'",
                " '" . $servers{$server}{port} . "'",
                " '" . $servers{$server}{master} . "'",
            );
            $self->debug( 2, "Terminal exec line:\n$exec\n" );
            exec($exec) == 0 or warn("Failed: $!");

lib/App/ClusterSSH.pm  view on Meta::CPAN

        $servers{$server}{active} = 1;    # mark as active
        $self->config->{internal_activate_autoquit}
            = 1;                          # activate auto_quit if in use
    }
    $self->debug( 2, "All client windows opened" );
    $self->config->{internal_total} = int( keys(%servers) );

    return $self;
}

sub get_font_size() {
    my ($self) = @_;
    $self->debug( 2, "Fetching font size" );

    # get atom name<->number relations
    my $quad_width = $xdisplay->atom("QUAD_WIDTH");
    my $pixel_size = $xdisplay->atom("PIXEL_SIZE");

    my $font          = $xdisplay->new_rsrc;
    my $terminal_font = $self->config->{terminal_font};
    $xdisplay->OpenFont( $font, $terminal_font );

    my %font_info;

    eval { (%font_info) = $xdisplay->QueryFont($font); }
        || die( "Fatal: Unrecognised font used ($terminal_font).\n"
            . "Please amend \$HOME/.clusterssh/config with a valid font (see man page).\n"
        );

    $self->config->{internal_font_width}
        = $font_info{properties}{$quad_width};
    $self->config->{internal_font_height}
        = $font_info{properties}{$pixel_size};

    if (   !$self->config->{internal_font_width}
        || !$self->config->{internal_font_height} )
    {
        die(      "Fatal: Unrecognised font used ($terminal_font).\n"
                . "Please amend \$HOME/.clusterssh/config with a valid font (see man page).\n"
        );
    }

    $self->debug( 2, "Done with font size" );
    return $self;
}

sub show_console() {
    my ($self) = shift;
    $self->debug( 2, "Sending console to front" );

    $self->config->{internal_previous_state} = "mid-change";

    # fudge the counter to drop a redraw event;

lib/App/ClusterSSH.pm  view on Meta::CPAN

    # ALL SIZES SHOULD BE IN PIXELS for consistency

    $self->debug( 2, "Count is currently ", $self->config->{internal_total} );

    if ( $self->config->{internal_total} == 0 ) {

        # If nothing to tile, don't bother doing anything, just show console
        return $self->show_console();
    }

    # work out terminal pixel size from terminal size & font size
    # does not include any title bars or scroll bars - purely text area
    $self->config->{internal_terminal_cols}
        = ( $self->config->{terminal_size} =~ /(\d+)x.*/ )[0];
    $self->config->{internal_terminal_width}
        = (   $self->config->{internal_terminal_cols}
            * $self->config->{internal_font_width} )
        + $self->config->{terminal_decoration_width};

    $self->config->{internal_terminal_rows}
        = ( $self->config->{terminal_size} =~ /.*x(\d+)/ )[0];
    $self->config->{internal_terminal_height}
        = (   $self->config->{internal_terminal_rows}
            * $self->config->{internal_font_height} )
        + $self->config->{terminal_decoration_height};

    # fetch screen size
    $self->config->{internal_screen_height} = $xdisplay->{height_in_pixels};
    $self->config->{internal_screen_width}  = $xdisplay->{width_in_pixels};

    # Now, work out how many columns of terminals we can fit on screen
    if ( $self->config->{rows} != -1 || $self->config->{cols} != -1 ) {
        if ( $self->config->{rows} != -1 ) {
            $self->config->{internal_rows}    = $self->config->{rows};

lib/App/ClusterSSH.pm  view on Meta::CPAN

                    if ( $servers{$svr}{active} == 1 );
            }
        }
    );

    $windows{help} = $windows{main_window}->Dialog(
        -popover    => $windows{main_window},
        -overanchor => "c",
        -popanchor  => "c",
        -class      => 'cssh',
        -font       => [
            -family => "interface system",
            -size   => 10,
        ],
        -text =>
            "Cluster Administrator Console using SSH\n\nVersion: $VERSION.\n\n"
            . "Bug/Suggestions to http://clusterssh.sf.net/",
    );

    $windows{manpage} = $windows{main_window}->DialogBox(
        -popanchor  => "c",

lib/App/ClusterSSH.pm  view on Meta::CPAN

        }
        else {
            $sort = sub { Sort::Naturally::nsort(@_) };
        }
    }

    $self->config->dump() if ( $self->options->dump_config );

    $self->evaluate_commands() if ( $self->options->evaluate );

    $self->get_font_size();

    $self->load_keyboard_map();

    # read in normal cluster files
    $self->config->{extra_cluster_file} .= ',' . $self->options->cluster_file
        if ( $self->options->cluster_file );
    $self->config->{extra_tag_file} .= ',' . $self->options->tag_file
        if ( $self->options->tag_file );

    $self->cluster->get_cluster_entries( split /,/,

lib/App/ClusterSSH.pm  view on Meta::CPAN

=item getopts

=item list_tags

=item evaluate_commands

=item exit_prog

=item get_clusters

=item get_font_size

=item get_keycode_state

=item key_event

=item load_config_defaults

=item load_configfile

=item load_keyboard_map

lib/App/ClusterSSH/Config.pm  view on Meta::CPAN

# list of config items to not write out when writing the default config
my @ignore_default_config = (qw/ user /);

my %default_config = (
    terminal                   => "xterm",
    terminal_args              => "",
    terminal_title_opt         => "-T",
    terminal_colorize          => 1,
    terminal_bg_style          => 'dark',
    terminal_allow_send_events => "-xrm '*.VT100.allowSendEvents:true'",
    terminal_font              => "6x13",
    terminal_size              => "80x24",

    use_hotkeys             => "yes",
    key_quit                => "Alt-q",
    key_addhost             => "Control-Shift-plus",
    key_clientname          => "Alt-n",
    key_history             => "Alt-h",
    key_localname           => "Alt-l",
    key_retilehosts         => "Alt-r",
    key_macros_enable       => "Alt-p",

lib/App/ClusterSSH/Config.pm  view on Meta::CPAN

                $clusters->register_tag( $cluster,
                    split( / /, $read_config{$cluster} ) );
                $old_clusters{$cluster} = $read_config{$cluster};
                delete( $read_config{$cluster} );
            }
        }
        delete( $read_config{clusters} );
    }

    # tidy up entries, just in case
    $read_config{terminal_font} =~ s/['"]//g
        if ( $read_config{terminal_font} );

    $self->validate_args(%read_config);
}

sub load_configs {
    my ( $self, @configs ) = @_;

    for my $config (
        '/etc/csshrc',
        $ENV{HOME} . '/.csshrc',

lib/App/ClusterSSH/Getopt.pm  view on Meta::CPAN

        ),
    );
    $self->add_option(
        spec     => 'tag-file|r=s',
        arg_desc => 'filename',
        help     => $self->loc(
            'Use supplied file as additional tag file (see also L</"FILES">)'
        ),
    );
    $self->add_option(
        spec     => 'font|f=s',
        arg_desc => 'font',
        help     => $self->loc(
            'Specify the font to use in the terminal windows. Use standard X font notation such as "5x8".'
        ),
    );
    $self->add_option(
        spec => 'list|L:s',
        help => $self->loc(
            'List available cluster tags. Tag is optional.  If a tag is provided then hosts for that tag are listed.  NOTE: format of output changes when using "--quiet" or "-Q" option.'
        ),
        arg_desc     => 'tag',
        arg_optional => 1,
    );

lib/App/ClusterSSH/Getopt.pm  view on Meta::CPAN

    $self->parent->config->{title} = $self->title if ( $self->title );
    $self->parent->config->{port}  = $self->port  if ( $self->port );

    # note, need to check if these actions can be performed as they are
    # not common acorss all communiction methods
    $self->parent->config->{command} = $self->action
        if ( $self->can('action') && $self->action );
    $self->parent->config->{user} = $self->username
        if ( $self->can('username') && $self->username );

    $self->parent->config->{terminal_font} = $self->font if ( $self->font );
    $self->parent->config->{terminal_args} = $self->term_args
        if ( $self->term_args );

    $self->parent->config->{show_history} = 1 if ( $self->show_history );

    $self->parent->config->{auto_close} = $self->autoclose
        if ( $self->autoclose );

    if ( $self->autoquit ) {
        $self->parent->config->{auto_quit}

lib/App/ClusterSSH/Getopt.pm  view on Meta::CPAN

        q{When non-0, set the working directory for each terminal as per '[_1]'},
        'L<terminal_chdir_path>'
    );

    output '=item terminal_chdir_path = $HOME/.clusterssh/work/%s';
    output $self->loc(
        q{Path to use as working directory for each terminal when '[_1]' is enabled.  The path provided is passed through the macro parser (see the section above on '[_2]'.},
        'L<terminal_chdir>', 'L<macros_enabled>',
    );

    output '=item terminal_font = 6x13';
    output $self->loc(
        q{Font to use in the terminal windows.  Use standard X font notation.}
    );

    output '=item terminal_reserve_top = 5';
    output '=item terminal_reserve_bottom = 0';
    output '=item terminal_reserve_left = 5';
    output '=item terminal_reserve_right = 0';
    output $self->loc(
        q{Number of pixels from the terminal's side to reserve when calculating screen geometry for tiling.  Setting these will help keep cssh from positioning windows over your scroll and title bars or otherwise overlapping the windows too much.}
    );

t/15config.t  view on Meta::CPAN

$config = App::ClusterSSH::Config->new();
isa_ok( $config, 'App::ClusterSSH::Config' );

Readonly::Hash my %default_config => {
    terminal                   => "xterm",
    terminal_args              => "",
    terminal_title_opt         => "-T",
    terminal_colorize          => 1,
    terminal_bg_style          => 'dark',
    terminal_allow_send_events => "-xrm '*.VT100.allowSendEvents:true'",
    terminal_font              => "6x13",
    terminal_size              => "80x24",

    use_hotkeys             => "yes",
    key_quit                => "Alt-q",
    key_addhost             => "Control-Shift-plus",
    key_clientname          => "Alt-n",
    key_history             => "Alt-h",
    key_localname           => "Alt-l",
    key_retilehosts         => "Alt-r",
    key_macros_enable       => "Alt-p",

t/15config.t  view on Meta::CPAN

ssh_args=
telnet=telnet
telnet_args=
terminal=xterm
terminal_allow_send_events=-xrm '*.VT100.allowSendEvents:true'
terminal_args=
terminal_bg_style=dark
terminal_colorize=1
terminal_decoration_height=10
terminal_decoration_width=8
terminal_font=6x13
terminal_reserve_bottom=0
terminal_reserve_left=5
terminal_reserve_right=0
terminal_reserve_top=5
terminal_size=80x24
terminal_title_opt=-T
unique_servers=0
unmap_on_redraw=no
use_all_a_records=0
use_hotkeys=yes

t/15config.t.file3  view on Meta::CPAN

ssh=/usr/bin/ssh
ssh_args= -x -o ConnectTimeout=10
telnet_args=
terminal=/usr/bin/xterm
terminal_allow_send_events=-xrm '*.VT100.allowSendEvents:true'
terminal_args=
terminal_bg_style=dark
terminal_colorize=1
terminal_decoration_height=10
terminal_decoration_width=8
terminal_font=6x13
terminal_reserve_bottom=0
terminal_reserve_left=5
terminal_reserve_right=0
terminal_reserve_top=5
terminal_size=80x24
terminal_title_opt=-T
title=CSSH
unmap_on_redraw=no
use_hotkeys=yes
window_tiling=yes



( run in 0.572 second using v1.01-cache-2.11-cpan-5735350b133 )