Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: Net::SSH2::Cisco and Nexus switches

by VinsWorldcom (Prior)
on Aug 15, 2018 at 22:49 UTC ( #1220389=note: print w/replies, xml ) Need Help??

in reply to Re^2: Net::SSH2::Cisco and Nexus switches
in thread Net::SSH2::Cisco and Nexus switches

In waitfor(), if there is a timeout and waitfor_clear() is set, an ios_break('Z') (ctrl-z) is sent. That explains the Z. If you're confident you have the prompt correct, try experimenting with waitfor_clear().

  • Comment on Re^3: Net::SSH2::Cisco and Nexus switches

Replies are listed 'Best First'.
Re^4: Net::SSH2::Cisco and Nexus switches
by cnoyes72 (Initiate) on Aug 16, 2018 at 14:29 UTC

    Thanks again for the response.

    It looks like the prompt match still isn't working. There is something about the NX-OS prompt/response that the underlying net::telnet::cisco module doesn't like. It works great with IOS and IOS-XE. I did find that Control::CLI works great with NX-OS but doesn't work with IOS or IOS-XE (it behaves like nx-os did with net::ssh2::cisco). It could be that the NX-OS cli behaves just like a linux session; not surprising considering nx-os is layered upon linux. So I guess I'll have to use both modules in my backup script (that script works great with Net::Telnet today but we are trying to shutdown Telnet on the switches).

      Try enabling the dump_log which shows the hex characters. It could be how and where newlines are sent. They could be \r\n, \r, \n and you'll see this as hex 13 and 10 in the dump_log. Sometimes the prompt starts with a newline so you'll need to make sure the correct character is matched at the beginning. I'll admit I've had frustrations with this as well using Net::Telnet::Cisco way back when connecting to IOS-XR switches.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2021-01-22 03:41 GMT
Find Nodes?
    Voting Booth?