in reply to Re: Net::SSH::Perl and simaltaneous connections
in thread Net::SSH::Perl and simaltaneous connections

Is it possible that your server detects too many sessions from one ip and terminates the connection?

The problem is that the sessions are being made to different ip's in a concurrent fashion. So it's not just a (well not obviously at least) case of the destination server not allowing multiple simaltanoeus connections to it.

I can quite happily make as many active and non-active connections to the same ip without drama, by both hand and through the script.

could you please update the node with your Parallel::ForkManager code and I can run a quick check on my server?

A cutdown, very simple version of what I'm doing would be as follows:

#!/usr/bin/perl -w use strict; use Parallel::ForkManager; my (@hosts) = ("192.168.0.1","192.168.0.2","192.168.0.3"); my $sshscript = "ssh.pl"; my $maxProbes = 3; # set this to one to do one at a time my $pm = new Parallel::ForkManager($maxProbes); foreach my $hostname (@hosts) { $pm->start and next; my $stdout = `./$sshscript $hostname`; print "$stdout\n"; $pm->finish; } $pm->wait_all_children; print "done\n";

with the snippet from the original node saved as ssh.pl and adjusted so that it set $host to the value of $ARGV[0]

Cheers for your time and reply.

Anth

Replies are listed 'Best First'.
Re^3: Net::SSH::Perl and simaltaneous connections
by sk (Curate) on Aug 25, 2005 at 05:34 UTC
    I am terribly sorry. I am going to give up on this :(

    I am on Windows XP SP2. I have to use Window$ because I don't have permissions to install modules on my Linux server.

    I just couldn't get Math::GMP to install and so protocol => 1 bombs. So i am using protocol => 2. I played around with the source code on Net::SSH::Perl but couldn't understand why my Linux servers ssh version is a no-compat!

    C:\>perl connect.pl HOME: Reading configuration data c:/.ssh/config HOME: Reading configuration data /etc/ssh_config HOME: Connecting to 192.168.2.1, port 22. HOME: Reading configuration data c:/.ssh/config HOME: Reading configuration data /etc/ssh_config HOME: Connecting to 192.168.2.8, port 22. HOME: Remote protocol version 2.0, remote software version OpenSSH_3.4 +p1 HOME: Remote protocol version 1.99, remote software version OpenSSH_3. +6.1p2 HOME: Net::SSH::Perl Version 1.28, protocol version 2.0. HOME: No compat match: OpenSSH_3.4p1. Can't set socket non-blocking: Bad file descriptor at C:/Perl/site/lib +/Net/SSH/P erl.pm line 214, <GEN0> line 1.