Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I wrote Net::SSH2::Cisco but never had Nexus switches to test on. It could be a lot of things, including the prompt string. From the CRAPPS utility I wrote:

... has an issue with prompt discovery on new Cisco IOS-XR routers. These routers have a prompt like: RP/0/RP1/CPU0:routername# The current Net::Telnet::Cisco prompt matching will not catch this and cause timeouts on Telnet connects to these types of routers. This script sends a new prompt that should match existing prompts and the new IOS-XR prompts. If you are having failed connect issues when in Telnet mode, but logging shows that you are connecting, the custom prompt is the first place to look. Net::Telnet::Cisco supplied prompt: '/(?m:^[\w.-]+\s?(?:\(config[^\)]*\))?\s?[\$#>]\s?(?:\(enable\)) +?\s*$)/' Updated by this program: (?:[\w.\/]+\:)? inserted after the "'/(?m:^" The rest of the line is left as is.

Note that I wrote Net::SSH2::Cisco as a drop in replacement for Net::Telnet::Cisco, so the same above should apply.

my $t = Net::SSH2::Cisco->new( [...] prompt => '/(?m:^ [...] s*$)/'; # or whatever matches your prompt );

Also agree with zentara; waitfor_clear shouldn't need to be messed with, but if you're going to, at least us integer 0 (not '0' string).


In reply to Re: Net::SSH2::Cisco and Nexus switches by VinsWorldcom
in thread Net::SSH2::Cisco and Nexus switches by cnoyes72

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found