Follow-on from my post above (Re: Using Net::SSH2::Cisco), I tested something simple against a 7200-series router:

#!perl use strict; use warnings; use Net::SSH2::Cisco; my $host = Net::SSH2::Cisco->new( host => '10.254.254.1', dump_log => 'out.txt', ); $host->login( name => 'cisco', password => 'cisco', ); my @ret = $host->cmd( "copy running-config tftp://192.168.100.254\n\n\n" ); print @ret; $host->close;

... and it works fine (note my TFTPd server is 'tftpd-simple.pl' supplied with the Net::TFTPd module)...

VinsWorldcom@C:\Users\VinsWorldcom\tmp> test.pl copy running-config tftp://192.168.100.254 Address or name of remote host [192.168.100.254]? Destination filename [r1-confg]? !! 9721 bytes copied in 4.400 secs (2209 bytes/sec)

I think you need to boil your script down to basics, get something that works, then starting adding the threads and other special stuff. Notice I didn't use waitfor() or change timeout() - I'm just using defaults. Note also that I tested and it works just as well when using Net::Telnet::Cisco (instead of Net::SSH2::Cisco - s/SSH2/Telnet/g) - as it should since Net::SSH2::Cisco is supposed to be a drop and replace SSH solution for the Net::Telnet::Cisco one.


In reply to Re: Using Net::SSH2::Cisco by VinsWorldcom
in thread Using Net::SSH2::Cisco by mroe1234

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.