[rancid] Fwd: Help ciena-ws Rancid 3.6.2

Tanner Lyle tannerlyle at gmail.com
Mon Jun 19 17:11:28 UTC 2017


Ciena Engineer provided the changes needed, prompts were not matching make
following changes to your wavesvros.pm file in /usr/local/rancid/lib/rancid/

[rancid at localhost rancid]$ pwd
/usr/local/rancid/lib/rancid

*wavesvros.pm <http://wavesvros.pm>*

*Line 112*
*change this line*
       while (/>\s*($cmds_regexp)\s*$/) {
*to this *
       while (/[#]\s*($cmds_regexp)\s*$/) {


*Line 115*
*change this line*
               $prompt = ($_ =~ /^([^>]+>)/)[0];
*to this*
               $prompt = ($_ =~ /^([^#]+#)/)[0];


*Line 140*
*change this line*
       if (/>\s*exit/) {
*to this*
       if (/\s*exit/) {


*Line 207 add *
        $found_end = 0;

*from this*

# This routine parses "configuration show"
sub WriteTerm {
    my($INPUT, $OUTPUT, $cmd) = @_;
    my($snmp) = 0;
    print STDERR "    In ShowConfiguration: $_" if ($debug);

    # include the command

*to this*

# This routine parses "configuration show"
sub WriteTerm {
    my($INPUT, $OUTPUT, $cmd) = @_;
    my($snmp) = 0;
        $found_end = 0;
    print STDERR "    In ShowConfiguration: $_" if ($debug);

    # include the command

*Original line 212 now line 214*

*from this *

    while (<$INPUT>) {
        tr/\015//d;
        last if (/^$prompt/);
        /no matching entry found/ && return(-1);        # unknown cmd

*to this*

    while (<$INPUT>) {
        tr/\015//d;
                return (0) if (/^$prompt/);
        /no matching entry found/ && return(-1);        # unknown cmd
            return (0) if ($found_end == 1);


*Change Line 265*

*from this*

       if (/^! END OF CONFIG:/) {

*to this*

        if (/! END OF CONFIG:/) {



For those of you better at reading diffs than me

[rancid at localhost rancid]$ diff wavesvros.pm wavesvros.pm.orig

112c112
<       while (/[#]\s*($cmds_regexp)\s*$/) {
---
>       while (/>\s*($cmds_regexp)\s*$/) {
115c115
<               $prompt = ($_ =~ /^([^#]+#)/)[0];
---
>               $prompt = ($_ =~ /^([^>]+>)/)[0];
140c140
<       if (/\s*exit/) {
---
>       if (/>\s*exit/) {
207d206
<       $found_end = 0;
215c214
<               return (0) if (/^$prompt/);
---
>       last if (/^$prompt/);
217d215
<           return (0) if ($found_end == 1);
265c263
<         if (/! END OF CONFIG:/) {
---
>       if (/^! END OF CONFIG:/) {


---------- Forwarded message ----------
From: Tanner Lyle <tannerlyle at gmail.com>
Date: Thu, Jun 8, 2017 at 7:29 AM
Subject: Help ciena-ws Rancid 3.6.2
To: rancid-discuss at shrubbery.net


I cannot get a Ciena Waveserver (192.168.168.32 in the files) to complete,
all commands run and login works but never makes it to the parse output or
get a PROMPT MATCH: like it's trying to run the perl module against the
device.  Trying to gain some traction on this, out of ideas and know how to
trouble shoot it.  Any suggestions, i think the problem is still in hlogin
or in the wavesvros.pm.

[rancid at localhost logs]$ export NOPIPE=YES && rancid -d -t ciena-ws
192.168.168.32
loadtype: device type ciena-ws
loadtype: found device type ciena-ws in /usr/local/rancid/etc/rancid.
types.base
executing hlogin -t 120 -c"software show;chassis show;configuration show"
192.168.168.32
192.168.168.32: missed cmd(s): all commands
192.168.168.32: End of run not found
!


I can get different devices to complete and run so i don't think it's a
permissions or install issue

[rancid at localhost logs]$ export NOPIPE=YES && rancid -d -t foundry 10.0.2.2
loadtype: device type foundry
loadtype: found device type foundry in /usr/local/rancid/etc/rancid.
types.base
executing flogin -t 90 -c"show version;show chassis;show module;show
media;show media validation;show flash;write term;show running-config"
10.0.2.2
PROMPT MATCH: telnet at LAB_MLX16#
HIT COMMAND:telnet at LAB_MLX16#show version
    In ShowVersion: telnet at LAB_MLX16#show version
HIT COMMAND:telnet at LAB_MLX16#show chassis
    In ShowChassis: telnet at LAB_MLX16#show chassis
HIT COMMAND:telnet at LAB_MLX16#show module
    In ShowModule: telnet at LAB_MLX16#show module
HIT COMMAND:telnet at LAB_MLX16#show media
    In ShowMedia: telnet at LAB_MLX16#show media
HIT COMMAND:telnet at LAB_MLX16#show media validation
    In ShowMedia: telnet at LAB_MLX16#show media validation
HIT COMMAND:telnet at LAB_MLX16#show flash
    In ShowFlash: telnet at LAB_MLX16#show flash
HIT COMMAND:telnet at LAB_MLX16#write term
    In WriteTerm: telnet at LAB_MLX16#write term
HIT COMMAND:telnet at LAB_MLX16#show running-config
    In WriteTerm: telnet at LAB_MLX16#show running-config
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20170619/ac5b5367/attachment.html>


More information about the Rancid-discuss mailing list