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

heasley heas at shrubbery.net
Thu Sep 3 20:48:15 UTC 2015


Thu, Sep 03, 2015 at 03:11:03AM -0400, Terry Kennedy:
>   I'm trying to monitor power supply / fan status on assorted Cisco gear.
> However, the Cisco CLI is inconsistent (so, what else is new?) across the
> various platforms.
> 
>   Here is a brief summary (all running their respective latest IOS - 15
> for everything except the 4948, 3750 and 2651XM, which are running 12).
> "Expected output" indicates a full (for that platform) report, while any-
> thing else is the error message or one-line status:
> 
>   Platform		    "show env all"		"show env"
>   ---------------------	    ------------------------	--------------------
>   Catalyst 4500X-16SFP+	    "Invalid input detected"	Expected output
>   Catalyst 4948-10GE	    "Invalid input detected"	Expected output
>   Catalyst 3750-48TS	    Expected output		"Incomplete command"
>   3845			    Expected output		Expected output
>   7206VXR / NPE-1	    Expected output		"All measured values
> 							are normal"
>   ASR1000		    Expected output		Expected output
>   2651XM		    Expected output		Expected output
>   ASA5506		    "Invalid input detected"	Expected output
> 
>   Some platforms only accept "show env all", some only accept "show env",
> some accept both and produce identical output and some accept both and
> produce different output.
> 
>   It seems that "the right thing" would be to try the "show env all" and
> only if that reports an error, try "show env". Simply sending both com-
> mands would seem to risk duplicate lines in the RANCID file for the cases
> where the device returns the same data for both commands, or a spurious
> "All measured values are normal" if it accepts both commands but returns
> different data.

there is code in ShowEnv to skip a second copy of the output if the first
succeeded.

>   I could clone the cisco device from rancid.types.base into multiple
> different sub-device types in rancid.types.conf, but that means a lot
> of extra work dealing with new RANCID versions. But that has the advan-
> tage of not having to parse wildly different output types in the same
> routine.
> 
>   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
> 
>   Has anybody waded through this morass previously and come up with a
> good solution?

thats an interesting idea.  more grammar would be needed for commands that
are order dependant.


More information about the Rancid-discuss mailing list