I put together Net::SSH2::Cisco from Net::Telnet, Net::Telnet::Cisco and Net::SSH2. You'll find the same limitations apply, specifically from Net::Telnet::Cisco:
http://search.cpan.org/~joshua/Net-Telnet-Cisco-1.10/Cisco.pm#Sending_multiple_lines_at_onceIf your command doesn't produce the regular prompt in return, you'll have an issue. When I try this on a 7200-series, I get:
R1#copy startup-config tftp://192.168.100.254 Address or name of remote host [192.168.100.254]? Destination filename [r1-confg]?
which will *DEFINITELY* be the cause of an issue since the prompt is not returned without pressing enter a few times. Try adding "\n\n\n" to the end of your cmd() 'String' value.
I see you're using waitfor() looking for "#", is that your prompt?
Did you try setting timeout() before issuing your cmd() calls? I see you have a 5 second timeout *after* the command is issued - that won't help. Try timeout(10) *before* issuing cmd().
Also, reading the POD from Net::Telnet and Net::Telnet::Cisco is highly recommended since I didn't port all the POD into this module and there are helpful examples about how to use those modules from which Net::SSH2::Cisco is based on.
In reply to Re: Using Net::SSH2::Cisco
by VinsWorldcom
in thread Using Net::SSH2::Cisco
by mroe1234
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |