[rancid] Re: GSR 12k - sho diag / missing subslot spa info

Yuval Ben Ari yuval.ben.ari at gmail.com
Sun Apr 6 11:14:48 UTC 2008


it works ok but it's a bit messy and will be hard to parse (I parse the
PID/SN from there)
any idea why we need the "raw" keyword? without it I still seem to have all
the info I need.
also I noticed that a 4GE-SFP-LC= linecard appears as PID: 800-22811-06
instead of the part name.
any idea if it's a bug?

On Mon, Mar 3, 2008 at 8:57 PM, Yuval Ben Ari <yuval.ben.ari at gmail.com>
wrote:

> thanks!, I will try it
>
>   On Mon, Mar 3, 2008 at 7:16 AM, Elliott, Andrew <AElliott at xo.com> wrote:
>
> > # This routine parses "show inventory".
> > sub ShowInventory {
> >    print STDERR "    In ShowInventory: $_" if ($debug);
> >
> >    while (<INPUT>) {
> >        tr/\015//d;
> >        return if (/^\s*\^$/);
> >        last if (/^$prompt/);
> >        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 (/command authorization failed/i);
> >        # the pager can not be disabled per-session on the PIX
> >        if (/^(<-+ More -+>)/) {
> >            my($len) = length($1);
> >            s/^$1\s{$len}//;
> >        }
> >
> >        if (/^(NAME: "[^"]*",) (DESCR: "[^"]+")/) {
> >            ProcessHistory("INVENTORY","","", sprintf("!%-30s %s\n", $1,
> > $2));
> >            next;
> >        }
> >        # split PID/VID/SN line
> >        if (/^PID: (\S*)\s*, VID: (\S*)\s*, SN: (\S*)\s*$/) {
> >            my($entries) = "";
> >            $entries .= "!PID: $1\n" if ($1);
> >            $entries .= "!VID: $2\n" if ($2);
> >            $entries .= "!SN: $3\n" if ($3);
> >            ProcessHistory("INVENTORY","","", "$entries");
> >            next;
> >        }
> >        ProcessHistory("INVENTORY","","","!$_");
> >    }
> >    ProcessHistory("INVENTORY","","","!\n");
> >
> >    return(0);
> > }
> >
> > And add this to your command table:
> >
> > @commandtable = (
> >        {'show inventory raw'           => 'ShowInventory'},
> >
> >
> > ---
> > Andrew Elliott
> > XO Communications
> > desk: 989.758.6987
> > cell: 989.213.5794
> >
> >
> >
> >
> >
> >
> > ________________________________
> >
> >        From: Yuval Ben Ari [mailto:yuval.ben.ari at gmail.com]
> >        Sent: Sunday, March 02, 2008 9:13 AM
> >        To: Elliott, Andrew
> >        Cc: rancid-discuss at shrubbery.net
> >        Subject: Re: [rancid] Re: GSR 12k - sho diag / missing subslot
> > spa info
> >
> >
> >        I am also having the same problem, and I am also interested to
> > have the S/N of the SPA
> >        Indeed "show inventory" seems the best way to do it.
> >        has anyone added "show inventory" parser yet?
> >        otherwise I can try to add it and post here.
> >
> >        Yuval
> >
> >
> >        On Wed, Jun 27, 2007 at 10:50 PM, Elliott, Andrew
> > <AElliott at xo.com> wrote:
> >
> >
> >
> >                > > Hello,
> >                > >
> >                > > I have been recently asked that my router backups
> > include
> >                > the SUBSLOT
> >                > > line from 'sho diag' on the 12k's.
> >                > >
> >                > > Here is an example (trimmed for brevity) of the
> > output I
> >                > want rancid to
> >                > > parse:
> >                > >
> >                > > SLOT 1  (RP/LC 1 ): Modular SPA Interface Card (10G)
> >                > > -snip-
> >                > >
> >                > >   SPA Information:
> >                > >         subslot 1/0: SPA-10X1GE-V2 (0x508), status
> > is ok
> >                > >         subslot 1/1: Empty
> >                > >         subslot 1/2: Empty
> >                > >         subslot 1/3: Empty
> >                > >
> >                > > SUBSLOT  1/0 (SPA-10X1GE-V2): 10-port Gigabit
> > Ethernet Shared Port
> >                > > Adapter
> >                > >         Product Identifier (PID) : SPA-10X1GE-V2
> >                > > -snip-
> >                > >
> >                > > This is a new card type that we have recently begun
> > deploying, and
> >                > > currently all that is backed up is the main SPA IC
> >                > information, not the
> >                > > info on the "SUBSLOT" or "SPA -> subslot" lines.
> >                >
> >                > I'd need to have the complete output; I don't have
> > GSRs anymore.
> >                >
> >
> >                CHR1.NYC-NY#sho diag 1
> >
> >
> >                SLOT 1  (RP/LC 1 ): Modular SPA Interface Card (10G)
> >
> >                 MAIN: type 149,  00-0000-00 rev A0
> >                       Deviation:  D090170
> >                       HW config: 0x20    SW key: 00-00-00
> >                 PCA:  00-00000-00 rev A0 ver 4
> >                       Design Release 1.0  S/N SAD000000M0
> >                 MBUS: Embedded Agent
> >                       Test hist: 0x00    RMA#: 00-00-00    RMA hist:
> > 0x00
> >                 DIAG: Test count: 0x00000000    Test results:
> > 0x00000000
> >                 FRU:  Linecard/Module: 12000-SIP-601=
> >                       Processor Memory: MEM-LC5-2048=(Non-Replaceable)
> >                       Packet Memory: MEM-LC5-PKT-256=(Non-Replaceable)
> >                 L3 Engine: 5 - ISE 10 Gbps
> >                 MBUS Agent Software version 2.51 (RAM) (ROM version is
> > 3.50)
> >                 ROM Monitor version 17.1
> >                 Fabric Downloader version used 4.1 (ROM version is 4.1)
> >                 Primary clock is CSC 1
> >                 Board is analyzed
> >                 Board State is Line Card Enabled (IOS  RUN )
> >                 Insertion time: 00:22:52 (2w4d ago)
> >                 Processor Memory size: 2147483648 bytes
> >                 TX Packet Memory size: 268435456 bytes, Packet Memory
> > pagesize: 32768
> >                bytes
> >                 RX Packet Memory size: 268435456 bytes, Packet Memory
> > pagesize: 32768
> >                bytes
> >                 0 crashes since restart
> >
> >
> >                 SPA Information:
> >                       subslot 1/0: SPA-10X1GE-V2 (0x508), status is ok
> >                       subslot 1/1: Empty
> >                       subslot 1/2: Empty
> >                       subslot 1/3: Empty
> >
> >                CHR1.NYC-NY#
> >
> >
> >                >
> >                > > It is possible I am using a version of rancid that
> > needs to
> >                > be upgraded
> >                > > and/or patched.
> >                >
> >                > possibly.  'show inventory' has been added and that
> > ought to
> >                > include this
> >                > information...if cisco has gotten around to adding it
> > to this platform
> >                > yet.
> >                >
> >
> >
> >                Looks like this might be the best way to go.  From the
> > show inventory:
> >
> >                NAME: "slot 1", DESCR: "ISE 10G Modular Services Card
> > v2"
> >                PID: 12000-SIP-601     , VID: V02, SN: SAD111403M0
> >
> >                NAME: "SPA subslot 1/0", DESCR: "10-port Gigabit
> > Ethernet Shared Port
> >                Adapter"
> >                PID: SPA-10X1GE-V2     , VID: V01, SN: JAB111701NG
> >
> >
> >                _______________________________________________
> >                Rancid-discuss mailing list
> >                Rancid-discuss at shrubbery.net
> >
> > http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
> >
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20080406/75d6a38a/attachment.html 


More information about the Rancid-discuss mailing list