Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Using Net::SSH2::Cisco

by VinsWorldcom (Prior)
on Dec 16, 2015 at 19:33 UTC ( [id://1150540]=note: print w/replies, xml ) Need Help??


in reply to Using Net::SSH2::Cisco

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_once

If 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1150540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-23 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found