[rancid] "show env all" vs. "show env" on Cisco IOS

Terry Kennedy TERRY at tmk.com
Sat Sep 5 23:23:13 UTC 2015

> >   What would be great is if rancid.types.conf had an "inherit" state-
> > ment that would let me include a device type from rancid.types.base
> > and then let me add (or possibly remove) commands, something like this:
> >
> > cisco-env;inherit;cisco
> > cisco-env;command;ios_local::ShowEnv_local;show env
> >
> > cisco-no-env;inherit;cisco
> > cisco-no-env;nocommand;;show env all
> thats an interesting idea.  more grammar would be needed for commands that
> are order dependant.

  Perhaps numbering the lines in the rancid.types.base file, similar to the
way IOS numbers entries in access lists to allow insertions?

  It would probably make sense to add this to the end of each command and
make it optional so existing local rancid.types.conf files wouldn't break
due to the syntax change. Something like:

# Cisco IOS device & Allied Telesis AW+
cisco;script;rancid -t cisco
cisco;command;ios::ShowVersion;show version;100
cisco;command;ios::ShowRedundancy;show redundancy secondary;110
cisco;command;ios::ShowIDprom;show idprom backplane;120
cisco;command;ios::ShowInstallActive;show install active;130
cisco;command;ios::ShowEnv;show env all;140
cisco;command;ios::ShowRSP;show rsp chassis-info;150
cisco;command;ios::ShowGSR;show gsr chassis;160
cisco;command;ios::ShowGSR;show diag chassis-info;170

  and then rancid.types.conf would have:

# Replace sequence 140
cisco-env;command;ios_local::ShowEnv_local;show env;140

# Add new sequence 145
cisco-add-env;command;ios_local::ShowEnv_local;show env;145

# Delete sequence 140

  Alternatively, if some device require the use of semicolons in their
commands, the syntax could be:

cisco;command:100;ios::ShowVersion;show version;
cisco;command:110;ios::ShowRedundancy;show redundancy secondary
cisco;command:120;ios::ShowIDprom;show idprom backplane
cisco;command:130;ios::ShowInstallActive;show install active
cisco;command:140;ios::ShowEnv;show env all
cisco;command:150;ios::ShowRSP;show rsp chassis-info
cisco;command:160;ios::ShowGSR;show gsr chassis
cisco;command:170;ios::ShowGSR;show diag chassis-info

  The use of colons to indicate the command sequence should still keep old
files compatible - if there is no colon in the command, simply execute them
in the order found (the old way).

        Terry Kennedy             http://www.tmk.com
        terry at tmk.com             New York, NY USA

More information about the Rancid-discuss mailing list