in reply to Net::SSH2::Cisco and Nexus switches
... 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.
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).
|Replies are listed 'Best First'.|
Re^2: Net::SSH2::Cisco and Nexus switches
by cnoyes72 (Initiate) on Aug 15, 2018 at 20:16 UTC