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