I am trying to setup a FORM fed CGI script to test Cisco Terminal servers for specific standards. One set of standards it to test if Telnet is blocked and SSH enabled.

Below is what I currently have:
#Begin telnet access test and display results $telnet = Net::Telnet->new(Timeout => 10, Errmode => "return"); if ($telnet->open($tsip)) { $| = 1; print '<TD align=center bgcolor=#ff0000>Granted</TD>'; $| = 0; $tstelnettest = 1; } else { $| = 1; print '<TD align=center bgcolor=#00ff00>Denied</TD>'; $| = 0; $tstelnettest = 0; } $telnet->close; #Begin SSH access test and display results if ($ssh = Net::SSH::Perl->new("$tsip")) { print '<TD align=center bgcolor=#00FF00>Granted</TD>'; $tssshtest = 1; } else { print '<TD align=center bgcolor=#FF0000>Denied</TD>'; $tssshtest = 0; }
The Telnet test works just fine. However the SSH test dies. Here are the server log entries:

Thu Nov 24 12:55:36 2005 error client x.x.x.x Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.0/Net/SSH/Perl.pm line 107., referer: http://www.?????.net/index.php?module=htmlpages&func=display&pid=7 Thu Nov 24 12:55:36 2005 error client x.x.x.x Can't connect to 24.52.242.6, port 22: Connection refused at /usr/lib/perl5/site_perl/5.8.0/Net/SSH/Perl.pm line 204., referer: http://www.?????.net/index.php?module=htmlpages&func=display&pid=7

At this point the CGI dies and all other desired testing stops. Is there any way to force the SSH attempt to "return" like the Telnet attempt?

Any assistance would be greatly appreciated. Thanks in advance.

In reply to SSH connection refusal kills CGI by Dranzaz

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.