Discussion:
[rancid] Cisco commands in 3.6.2
Craig Hopkins
2017-06-28 09:10:23 UTC
Permalink
Hi,

rancid is happily backing up my ASAs and switches, but in rancid.types.base
I can see

cisco;command;ios::ShowInventory;show inventory raw

How do I get rancid to run this command on a Cisco? It isn't currently. It
looks like it's just doing show version, show flash and show running.

Cheers,

Craig
heasley
2017-06-28 17:32:56 UTC
Permalink
Post by Craig Hopkins
Hi,
rancid is happily backing up my ASAs and switches, but in rancid.types.base
I can see
cisco;command;ios::ShowInventory;show inventory raw
How do I get rancid to run this command on a Cisco? It isn't currently. It
looks like it's just doing show version, show flash and show running.
it is run; but if the command is not supported by the device or is different
on the ASA (because cisco is incapable of consistency between platforms) and
therefore is "ambiguous", that failure will be ignored by rancid. if you
know what the correct command is for the ASA, lmk.
Piegorsch, Weylin William
2017-06-28 20:30:32 UTC
Permalink
Does this help? I just ran this on an ASA I currently have in Rancid (v3.4).
weylin

ASA5545-X-version9.4(4)5/pri/act# sh inventory ?

<0-3> Inventory slot number
| Output modifiers
<cr>
ASA5545-X-version9.4(4)5/pri/act# sh inventory

-----Original Message-----
From: heasley <***@shrubbery.net>
Date: Wednesday, June 28, 2017 at 13:32
To: Craig Hopkins <***@gmail.com>
Cc: <rancid-***@shrubbery.net>
Subject: Re: [rancid] Cisco commands in 3.6.2
Post by Craig Hopkins
Hi,
rancid is happily backing up my ASAs and switches, but in rancid.types.base
I can see
cisco;command;ios::ShowInventory;show inventory raw
How do I get rancid to run this command on a Cisco? It isn't currently. It
looks like it's just doing show version, show flash and show running.
it is run; but if the command is not supported by the device or is different
on the ASA (because cisco is incapable of consistency between platforms) and
therefore is "ambiguous", that failure will be ignored by rancid. if you
know what the correct command is for the ASA, lmk.
heasley
2017-06-28 22:07:44 UTC
Permalink
Post by Piegorsch, Weylin William
Does this help? I just ran this on an ASA I currently have in Rancid (v3.4).
weylin
ASA5545-X-version9.4(4)5/pri/act# sh inventory ?
<0-3> Inventory slot number
| Output modifiers
<cr>
ASA5545-X-version9.4(4)5/pri/act# sh inventory
yes; it doesnt support the raw keyword. What does the o/p look like (w/o a
slot speicfied)?
Post by Piegorsch, Weylin William
-----Original Message-----
Date: Wednesday, June 28, 2017 at 13:32
Subject: Re: [rancid] Cisco commands in 3.6.2
Post by Craig Hopkins
Hi,
rancid is happily backing up my ASAs and switches, but in rancid.types.base
I can see
cisco;command;ios::ShowInventory;show inventory raw
How do I get rancid to run this command on a Cisco? It isn't currently. It
looks like it's just doing show version, show flash and show running.
it is run; but if the command is not supported by the device or is different
on the ASA (because cisco is incapable of consistency between platforms) and
therefore is "ambiguous", that failure will be ignored by rancid. if you
know what the correct command is for the ASA, lmk.
Piegorsch, Weylin William
2017-06-28 22:13:41 UTC
Permalink
ASA5545-X-version9.4(4)5/pri/act# sh inventory
Name: "Chassis", DESCR: "ASA 5545-X with SW, 8 GE Data, 1 GE Mgmt"
PID: ASA5545 , VID: V02 , SN: FTX184410TS

Name: "power supply 0", DESCR: "ASA 5545-X/5555-X AC Power Supply"
PID: ASA-PWR-AC , VID: N/A , SN: 48V1FE

Name: "power supply 1", DESCR: "ASA 5545-X/5555-X AC Power Supply"
PID: ASA-PWR-AC , VID: N/A , SN: 48V1FF

Name: "Storage Device 1", DESCR: "Model Number: Micron_M550_MTFDDAK128MAY"
PID: N/A , VID: N/A , SN: MXA183501WN

Name: "Storage Device 2", DESCR: "Model Number: Micron_M550_MTFDDAK128MAY"
PID: N/A , VID: N/A , SN: MXA183501QL

ASA5545-X-version9.4(4)5/pri/act#

-----Original Message-----
From: heasley <***@shrubbery.net>
Date: Wednesday, June 28, 2017 at 18:07
To: Weylin Piegorsch <***@bu.edu>
Cc: heasley <***@shrubbery.net>, Craig Hopkins <***@gmail.com>, "rancid-***@shrubbery.net" <rancid-***@shrubbery.net>
Subject: Re: [rancid] Cisco commands in 3.6.2
Post by Piegorsch, Weylin William
Does this help? I just ran this on an ASA I currently have in Rancid (v3.4).
weylin
ASA5545-X-version9.4(4)5/pri/act# sh inventory ?
<0-3> Inventory slot number
| Output modifiers
<cr>
ASA5545-X-version9.4(4)5/pri/act# sh inventory
yes; it doesnt support the raw keyword. What does the o/p look like (w/o a
slot speicfied)?
Post by Piegorsch, Weylin William
-----Original Message-----
Date: Wednesday, June 28, 2017 at 13:32
Subject: Re: [rancid] Cisco commands in 3.6.2
Post by Craig Hopkins
Hi,
rancid is happily backing up my ASAs and switches, but in rancid.types.base
I can see
cisco;command;ios::ShowInventory;show inventory raw
How do I get rancid to run this command on a Cisco? It isn't currently. It
looks like it's just doing show version, show flash and show running.
it is run; but if the command is not supported by the device or is different
on the ASA (because cisco is incapable of consistency between platforms) and
therefore is "ambiguous", that failure will be ignored by rancid. if you
know what the correct command is for the ASA, lmk.
Craig Hopkins
2017-06-29 10:18:00 UTC
Permalink
On a Catalyst switch:

#show inventory ?
WORD Entity name
raw Show every entity in the container hierarchy
| Output modifiers
<cr>

so raw is supported, and I can see that in the backups.

The ASAs only support show inventory, though.

So should I just remove raw from the end of the command in rancid base
types, and then it will work for all devices?
Post by Piegorsch, Weylin William
ASA5545-X-version9.4(4)5/pri/act# sh inventory
Name: "Chassis", DESCR: "ASA 5545-X with SW, 8 GE Data, 1 GE Mgmt"
PID: ASA5545 , VID: V02 , SN: FTX184410TS
Name: "power supply 0", DESCR: "ASA 5545-X/5555-X AC Power Supply"
PID: ASA-PWR-AC , VID: N/A , SN: 48V1FE
Name: "power supply 1", DESCR: "ASA 5545-X/5555-X AC Power Supply"
PID: ASA-PWR-AC , VID: N/A , SN: 48V1FF
Name: "Storage Device 1", DESCR: "Model Number: Micron_M550_MTFDDAK128MAY"
PID: N/A , VID: N/A , SN: MXA183501WN
Name: "Storage Device 2", DESCR: "Model Number: Micron_M550_MTFDDAK128MAY"
PID: N/A , VID: N/A , SN: MXA183501QL
ASA5545-X-version9.4(4)5/pri/act#
-----Original Message-----
Date: Wednesday, June 28, 2017 at 18:07
Subject: Re: [rancid] Cisco commands in 3.6.2
Post by Piegorsch, Weylin William
Does this help? I just ran this on an ASA I currently have in
Rancid (v3.4).
Post by Piegorsch, Weylin William
weylin
ASA5545-X-version9.4(4)5/pri/act# sh inventory ?
<0-3> Inventory slot number
| Output modifiers
<cr>
ASA5545-X-version9.4(4)5/pri/act# sh inventory
yes; it doesnt support the raw keyword. What does the o/p look like (w/o a
slot speicfied)?
Post by Piegorsch, Weylin William
-----Original Message-----
Date: Wednesday, June 28, 2017 at 13:32
Subject: Re: [rancid] Cisco commands in 3.6.2
Post by Craig Hopkins
Hi,
rancid is happily backing up my ASAs and switches, but in
rancid.types.base
Post by Piegorsch, Weylin William
Post by Craig Hopkins
I can see
cisco;command;ios::ShowInventory;show inventory raw
How do I get rancid to run this command on a Cisco? It isn't
currently. It
Post by Piegorsch, Weylin William
Post by Craig Hopkins
looks like it's just doing show version, show flash and show
running.
Post by Piegorsch, Weylin William
it is run; but if the command is not supported by the device or
is different
Post by Piegorsch, Weylin William
on the ASA (because cisco is incapable of consistency between
platforms) and
Post by Piegorsch, Weylin William
therefore is "ambiguous", that failure will be ignored by
rancid. if you
Post by Piegorsch, Weylin William
know what the correct command is for the ASA, lmk.
Craig Hopkins
2017-06-29 12:33:08 UTC
Permalink
Just for fun, I've made that change anyway, and it's giving me what I need.
Thanks for everyone for the input.
Post by Craig Hopkins
#show inventory ?
WORD Entity name
raw Show every entity in the container hierarchy
| Output modifiers
<cr>
so raw is supported, and I can see that in the backups.
The ASAs only support show inventory, though.
So should I just remove raw from the end of the command in rancid base
types, and then it will work for all devices?
Post by Piegorsch, Weylin William
ASA5545-X-version9.4(4)5/pri/act# sh inventory
Name: "Chassis", DESCR: "ASA 5545-X with SW, 8 GE Data, 1 GE Mgmt"
PID: ASA5545 , VID: V02 , SN: FTX184410TS
Name: "power supply 0", DESCR: "ASA 5545-X/5555-X AC Power Supply"
PID: ASA-PWR-AC , VID: N/A , SN: 48V1FE
Name: "power supply 1", DESCR: "ASA 5545-X/5555-X AC Power Supply"
PID: ASA-PWR-AC , VID: N/A , SN: 48V1FF
Name: "Storage Device 1", DESCR: "Model Number: Micron_M550_MTFDDAK128MAY"
PID: N/A , VID: N/A , SN: MXA183501WN
Name: "Storage Device 2", DESCR: "Model Number: Micron_M550_MTFDDAK128MAY"
PID: N/A , VID: N/A , SN: MXA183501QL
ASA5545-X-version9.4(4)5/pri/act#
-----Original Message-----
Date: Wednesday, June 28, 2017 at 18:07
Subject: Re: [rancid] Cisco commands in 3.6.2
Post by Piegorsch, Weylin William
Does this help? I just ran this on an ASA I currently have in
Rancid (v3.4).
Post by Piegorsch, Weylin William
weylin
ASA5545-X-version9.4(4)5/pri/act# sh inventory ?
<0-3> Inventory slot number
| Output modifiers
<cr>
ASA5545-X-version9.4(4)5/pri/act# sh inventory
yes; it doesnt support the raw keyword. What does the o/p look like (w/o a
slot speicfied)?
Post by Piegorsch, Weylin William
-----Original Message-----
Date: Wednesday, June 28, 2017 at 13:32
Subject: Re: [rancid] Cisco commands in 3.6.2
Post by Craig Hopkins
Hi,
rancid is happily backing up my ASAs and switches, but in
rancid.types.base
Post by Piegorsch, Weylin William
Post by Craig Hopkins
I can see
cisco;command;ios::ShowInventory;show inventory raw
How do I get rancid to run this command on a Cisco? It isn't
currently. It
Post by Piegorsch, Weylin William
Post by Craig Hopkins
looks like it's just doing show version, show flash and show
running.
Post by Piegorsch, Weylin William
it is run; but if the command is not supported by the device or
is different
Post by Piegorsch, Weylin William
on the ASA (because cisco is incapable of consistency between
platforms) and
Post by Piegorsch, Weylin William
therefore is "ambiguous", that failure will be ignored by
rancid. if you
Post by Piegorsch, Weylin William
know what the correct command is for the ASA, lmk.
heasley
2017-06-29 16:35:31 UTC
Permalink
Post by Craig Hopkins
Just for fun, I've made that change anyway, and it's giving me what I need.
Thanks for everyone for the input.
Post by Craig Hopkins
#show inventory ?
WORD Entity name
raw Show every entity in the container hierarchy
| Output modifiers
<cr>
so raw is supported, and I can see that in the backups.
The ASAs only support show inventory, though.
So should I just remove raw from the end of the command in rancid base
types, and then it will work for all devices?
Post by Piegorsch, Weylin William
ASA5545-X-version9.4(4)5/pri/act# sh inventory
Name: "Chassis", DESCR: "ASA 5545-X with SW, 8 GE Data, 1 GE Mgmt"
PID: ASA5545 , VID: V02 , SN: FTX184410TS
Name: "power supply 0", DESCR: "ASA 5545-X/5555-X AC Power Supply"
PID: ASA-PWR-AC , VID: N/A , SN: 48V1FE
Name: "power supply 1", DESCR: "ASA 5545-X/5555-X AC Power Supply"
PID: ASA-PWR-AC , VID: N/A , SN: 48V1FF
Name: "Storage Device 1", DESCR: "Model Number: Micron_M550_MTFDDAK128MAY"
PID: N/A , VID: N/A , SN: MXA183501WN
Name: "Storage Device 2", DESCR: "Model Number: Micron_M550_MTFDDAK128MAY"
PID: N/A , VID: N/A , SN: MXA183501QL
ASA5545-X-version9.4(4)5/pri/act#
thanks; this should do it.

Index: etc/rancid.types.base
===================================================================
--- etc/rancid.types.base (revision 3683)
+++ etc/rancid.types.base (working copy)
@@ -164,6 +164,7 @@
cisco;command;ios::ShowC7200;show c7200
cisco;command;ios::ShowCellular;show cellular 0 profile;Cellular modem
cisco;command;ios::ShowInventory;show inventory raw
+cisco;command;ios::ShowInventory;show inventory;ASA/PIX
cisco;command;ios::ShowVTP;show vtp status
cisco;command;ios::ShowVLAN;show vlan
cisco;command;ios::ShowVLAN;show vlan-switch
Index: lib/ios.pm.in
===================================================================
--- lib/ios.pm.in (revision 3660)
+++ lib/ios.pm.in (working copy)
@@ -23,6 +23,7 @@
our $found_version;
our $found_env;
our $found_diag;
+our $found_inventory;
our $config_register; # configuration register value

our %hwbuf; # defined in ShowContCbus
@@ -58,6 +59,7 @@
$found_version = 0;
$found_env = 0;
$found_diag = 0;
+ $found_inventory = 0;
$config_register = undef; # configuration register value

$supbootdisk = 0; # skip sup-bootflash if sup-bootdisk
@@ -1693,12 +1695,13 @@
while (<$INPUT>) {
tr/\015//d;
return if (/^\s*\^$/);
- last if (/^$prompt/);
+ if (/^$prompt/) { $found_inventory = 1; last};
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if (/Line has invalid autocommand /);
next if (/^\s+\^\s*$/);
return(1) if (/(invalid (input|command) detected|type help or )/i);
return(-1) if (/command authorization failed/i);
+ return(0) if ($found_inventory); # Only do this routine once
# the pager can not be disabled per-session on the PIX
if (/^(<-+ More -+>)/) {
my($len) = length($1);

Loading...