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


In reply to Re^2: Net::SSH::Perl and simaltaneous connections by anthski
in thread Net::SSH::Perl and simaltaneous connections by anthski

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.