[rancid] error in Cisco MDS config retrieval

Wayne Eisenberg Wayne.Eisenberg at CarolinasIT.com
Tue Aug 11 19:09:31 UTC 2015

That fixed it. You guys are great! Thanks again.


From: Dan Anderson [mailto:dan.w.anderson at gmail.com]
Sent: Monday, August 10, 2015 6:49 PM
To: Wayne Eisenberg
Cc: rancid-discuss at shrubbery.net
Subject: Re: [rancid] error in Cisco MDS config retrieval

It has to do with how NX-OS handles features that aren't enabled (and/or aren't available on that hardware platform).

In 3.1, I went into the nxrancid script and changed the return value for invalid commands since I have some devices that can use some of the stock commands and some cannot and I didn't want to create a slew of new device types.

diff -u nxrancid.orig nxrancid
--- nxrancid.orig       2014-09-24 10:02:46.017969251 -0400
+++ nxrancid    2014-09-24 10:03:06.039305060 -0400
@@ -660,7 +660,7 @@
        next if (/^(\s*|\s*$cmd\s*)$/);
        return(1) if /Line has invalid autocommand /;
        return(1) if /(Invalid input detected|Type help or )/;
-       return(-1) if (/\% Invalid command at /);
+       return(1) if (/\% Invalid command at /);
        return(-1) if (/\% Permission denied/);
        return(-1) if (/command authorization failed/i);

In 3.2, that has moved to the nxos module.

I'm sure there's probably a better way to handle it, but I was feeling pretty lazy at the time and haven't had a chance to revisit it.

On Mon, Aug 10, 2015 at 4:33 PM, Wayne Eisenberg <Wayne.Eisenberg at carolinasit.com<mailto:Wayne.Eisenberg at carolinasit.com>> wrote:
Hi all,

I have some Cisco MDS 9148 switches running NX-OS 5.2(2) (m9100-s3ek9-kickstart-mz.5.2.2.bin) and rancid is v3.1. Unfortunately I am not getting good retrievals from them. Below is the results of nxrancid –d. Can someone assist in understanding the problem and suggesting a solution?

[rancid at vm bin]$ nxrancid -d mds-9148-1.____.local

executing clogin -t 90 -c"term no monitor-force;show version;show version build-info all;show license;show license usage;show license host-id;show system redundancy status;show environment clock;show environment fan;show environment fex all fan;show environment temperature;show environment power;show boot;dir bootflash:;dir debug:;dir logflash:;dir slot0:;dir usb1:;dir usb2:;dir volatile:;show module;show module xbar;show inventory;show vtp status;show vlan;show debug;show cores vdc-all;show processes log vdc-all;show module fex;show fex;show running-config" mds-9148-1.____.local
PROMPT MATCH: Cisco-9148-Top#
HIT COMMAND:Cisco-9148-Top#  term no monitor-force
    In RunCommand: Cisco-9148-Top#  term no monitor-force
HIT COMMAND:Cisco-9148-Top# show version
    In ShowVersion: Cisco-9148-Top# show version
HIT COMMAND:Cisco-9148-Top# show version build-info all
    In ShowVersionBuild: Cisco-9148-Top# show version build-info all
HIT COMMAND:Cisco-9148-Top# show license
    In ShowLicense: Cisco-9148-Top# show license
HIT COMMAND:Cisco-9148-Top# show license usage
    In ShowLicense: Cisco-9148-Top# show license usage
HIT COMMAND:Cisco-9148-Top# show license host-id
    In ShowLicense: Cisco-9148-Top# show license host-id
HIT COMMAND:Cisco-9148-Top# show system redundancy status
    In ShowRedundancy: Cisco-9148-Top# show system redundancy status
HIT COMMAND:Cisco-9148-Top# show environment clock
    In ShowEnv: Cisco-9148-Top# show environment clock
HIT COMMAND:Cisco-9148-Top# show environment fan
    In ShowEnv: Cisco-9148-Top# show environment fan
HIT COMMAND:Cisco-9148-Top# show environment fex all fan
    In ShowEnv: Cisco-9148-Top# show environment fex all fan
HIT COMMAND:Cisco-9148-Top# show environment temperature
    In ShowEnvTemp: Cisco-9148-Top# show environment temperature
HIT COMMAND:Cisco-9148-Top# show environment power
    In ShowEnvPower: Cisco-9148-Top# show environment power
HIT COMMAND:Cisco-9148-Top# show boot
    In ShowBoot: Cisco-9148-Top# show boot
HIT COMMAND:Cisco-9148-Top# dir bootflash:
    In DirSlotN: Cisco-9148-Top# dir bootflash:
HIT COMMAND:Cisco-9148-Top# dir debug:
    In DirSlotN: Cisco-9148-Top# dir debug:
HIT COMMAND:Cisco-9148-Top# dir logflash:
    In DirSlotN: Cisco-9148-Top# dir logflash:
HIT COMMAND:Cisco-9148-Top# dir slot0:
    In DirSlotN: Cisco-9148-Top# dir slot0:
HIT COMMAND:Cisco-9148-Top# dir usb1:
    In DirSlotN: Cisco-9148-Top# dir usb1:
HIT COMMAND:Cisco-9148-Top# dir usb2:
    In DirSlotN: Cisco-9148-Top# dir usb2:
HIT COMMAND:Cisco-9148-Top# dir volatile:
    In DirSlotN: Cisco-9148-Top# dir volatile:
HIT COMMAND:Cisco-9148-Top# show module
    In ShowModule: Cisco-9148-Top# show module
HIT COMMAND:Cisco-9148-Top# show module xbar
    In ShowModule: Cisco-9148-Top# show module xbar
HIT COMMAND:Cisco-9148-Top# show inventory
    In ShowInventory: Cisco-9148-Top# show inventory
HIT COMMAND:Cisco-9148-Top# show vtp status
    In ShowVTP: Cisco-9148-Top# show vtp status
HIT COMMAND:Cisco-9148-Top# show vlan
    In ShowVLAN: Cisco-9148-Top# show vlan
HIT COMMAND:Cisco-9148-Top# show debug
    In ShowDebug: Cisco-9148-Top# show debug
HIT COMMAND:Cisco-9148-Top# show cores vdc-all
    In ShowCores: Cisco-9148-Top# show cores vdc-all
HIT COMMAND:Cisco-9148-Top# show processes log vdc-all
    In ShowProcLog: Cisco-9148-Top# show processes log vdc-all
mds-9148-1.____.local: show processes log vdc-all failed: -1
write(spawn_id=1): broken pipe
    while executing
"send_user -- "$expect_out(buffer)""
    invoked from within
"expect -nobrace -re+ { exp_continue } -re {^[^
*]*Cisco-9148-([^#>\r\n]+)?[#>](\([^)\r\n]+\))?} { send_user -- "$expect_out(buffer)"
                                                } -re {..."
    invoked from within
"expect {
            -re "\b+"                           { exp_continue }
            -re "^\[^\n\r *]*$reprompt"         { send_user -- "$expect_out(buffer)"
            -re "^\[^\n\r]*$reprom..."
    (procedure "run_commands" line 30)
    invoked from within
"run_commands $prompt $command"
    ("foreach" body line 196)
    invoked from within
"foreach router [lrange $argv $i end] {
    set router [string tolower $router]
    # attempt at platform switching.
    set platform ""
    send_user ..."
    (file "/usr/local/rancid3/bin/clogin" line 754)
mds-9148-1.____.local: missed cmd(s): show module fex,show fex,show running-config
mds-9148-1.____.local: missed cmd(s): show module fex,show fex,show running-config
mds-9148-1.____.local: End of run not found
mds-9148-1.____.local: End of run not found
mds-9148-1.____.local: clean: 0, end: 0
!PROC_LOGS:                                    ^
[rancid at vm bin]$

Wayne Eisenberg


The information in this Internet e-mail (and any attachments) is confidential, may be legally privileged and is intended solely for the Addressee(s) named above. If you are not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, then any dissemination or copying of this e-mail (and any attachments) is prohibited and may be unlawful. If you received this e-mail in error, please immediately notify us by e-mail or telephone, then delete the message. Thank you.

Rancid-discuss mailing list
Rancid-discuss at shrubbery.net<mailto:Rancid-discuss at shrubbery.net>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20150811/add4d6d2/attachment.html>

More information about the Rancid-discuss mailing list