Keep It Simple, Stupid | |
PerlMonks |
Re: Using Net::SSH2::Ciscoby VinsWorldcom (Prior) |
on Dec 16, 2015 at 19:33 UTC ( [id://1150540]=note: print w/replies, xml ) | Need Help?? |
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:
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 Section
Seekers of Perl Wisdom
|
|