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

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

by cnoyes72 (Initiate)
on Aug 15, 2018 at 20:16 UTC ( [id://1220388]=note: print w/replies, xml ) Need Help??


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

Thanks for the response. It looks like the nexus prompt adds a space after the "#" character. However, now the script appears to be prepending a "Z" before the command. I haven't changed anything in the script beside the prompt match, this makes no sense.

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

Replies are listed 'Best First'.
Re^3: Net::SSH2::Cisco and Nexus switches
by VinsWorldcom (Prior) on Aug 15, 2018 at 22:49 UTC

    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().

      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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-16 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found