Here is a quick synopsis of what I am doing, and the error(s) I am receiving.

I have about 40 computers that I use Net::OpenSSH to connect to. It will connect to one of the remote computers, check for the existence of a process using a simple shell command (using ssh->system). If the process is not running, it then uses the ssh->spawn method to launch it. Finally, I use the capture2 method to read some data that is generated by the process that was spawned (or running) earlier.

This process loops through the ~40 remote computers constantly for a given period of time (can be days)

Everything works fine... for awhile. Randomly, the Net::OpenSSH module will puke and kill the script (Killed by Signal 1). I start to see the following before the script is killed....:

"Use of unitialized value $check in pattern match (m//) at /usr/local/ +lib/perl5/site_perl/5.12.2/Net/OpenSSH.pm line 662" "Use of unitialized value $check in pattern match (m//) at /usr/local/ +lib/perl5/site_perl/5.12.2/Net/OpenSSH.pm line 671"

And $ssh->error prints "unable to establish master SSH Connection: Unknown error"

Any ideas as to why everything would work fine, but eventually (and randomly) to spitting out these errors and finally kill the script?

This is all on MAC OS X (10.5 or above).

If anymore information is needed, please let me know and I'll post more details as needed. Thanks!


In reply to Net::OpenSSH killing script by jaiieq

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.