[rancid] Cisco commands in 3.6.2
heasley
heas at shrubbery.net
Thu Jun 29 16:35:31 UTC 2017
Thu, Jun 29, 2017 at 01:33:08PM +0100, 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.
>
> On 29 June 2017 at 11:18, Craig Hopkins <c.o.hopkins at gmail.com> wrote:
>
> > 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?
> >
> > On 28 June 2017 at 23:13, Piegorsch, Weylin William <weylin at bu.edu> wrote:
> >
> >> 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);
More information about the Rancid-discuss
mailing list