it works ok but it&#39;s a bit messy and will be hard to parse (I parse the PID/SN from there)<br>any idea why we need the &quot;raw&quot; keyword? without it I still seem to have all the info I need.<br>also I noticed that a 4GE-SFP-LC= linecard appears as PID: 800-22811-06&nbsp; instead of the part name.<br>
any idea if it&#39;s a bug?<br><br>
<div class="gmail_quote">On Mon, Mar 3, 2008 at 8:57 PM, Yuval Ben Ari &lt;<a href="mailto:yuval.ben.ari@gmail.com">yuval.ben.ari@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>thanks!, I will try it<br><br></div>
<div>
<div></div>
<div class="Wj3C7c">
<div class="gmail_quote">On Mon, Mar 3, 2008 at 7:16 AM, Elliott, Andrew &lt;<a href="mailto:AElliott@xo.com" target="_blank">AElliott@xo.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"># This routine parses &quot;show inventory&quot;.<br>sub ShowInventory {<br>&nbsp; &nbsp;print STDERR &quot; &nbsp; &nbsp;In ShowInventory: $_&quot; if ($debug);<br>
<br>&nbsp; &nbsp;while (&lt;INPUT&gt;) {<br>&nbsp; &nbsp; &nbsp; &nbsp;tr/\015//d;<br>&nbsp; &nbsp; &nbsp; &nbsp;return if (/^\s*\^$/);<br>&nbsp; &nbsp; &nbsp; &nbsp;last if (/^$prompt/);<br>&nbsp; &nbsp; &nbsp; &nbsp;next if (/^(\s*|\s*$cmd\s*)$/);<br>&nbsp; &nbsp; &nbsp; &nbsp;return(1) if /Line has invalid autocommand /;<br>&nbsp; &nbsp; &nbsp; &nbsp;return(1) if /(Invalid input detected|Type help or )/;<br>
&nbsp; &nbsp; &nbsp; &nbsp;return(-1) if (/command authorization failed/i);<br>&nbsp; &nbsp; &nbsp; &nbsp;# the pager can not be disabled per-session on the PIX<br>&nbsp; &nbsp; &nbsp; &nbsp;if (/^(&lt;-+ More -+&gt;)/) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;my($len) = length($1);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s/^$1\s{$len}//;<br>
&nbsp; &nbsp; &nbsp; &nbsp;}<br><br>&nbsp; &nbsp; &nbsp; &nbsp;if (/^(NAME: &quot;[^&quot;]*&quot;,) (DESCR: &quot;[^&quot;]+&quot;)/) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ProcessHistory(&quot;INVENTORY&quot;,&quot;&quot;,&quot;&quot;, sprintf(&quot;!%-30s %s\n&quot;, $1,<br>$2));<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;next;<br>&nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; &nbsp; &nbsp;# split PID/VID/SN line<br>&nbsp; &nbsp; &nbsp; &nbsp;if (/^PID: (\S*)\s*, VID: (\S*)\s*, SN: (\S*)\s*$/) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;my($entries) = &quot;&quot;;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$entries .= &quot;!PID: $1\n&quot; if ($1);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$entries .= &quot;!VID: $2\n&quot; if ($2);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$entries .= &quot;!SN: $3\n&quot; if ($3);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ProcessHistory(&quot;INVENTORY&quot;,&quot;&quot;,&quot;&quot;, &quot;$entries&quot;);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;next;<br>
&nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; &nbsp; &nbsp;ProcessHistory(&quot;INVENTORY&quot;,&quot;&quot;,&quot;&quot;,&quot;!$_&quot;);<br>&nbsp; &nbsp;}<br>&nbsp; &nbsp;ProcessHistory(&quot;INVENTORY&quot;,&quot;&quot;,&quot;&quot;,&quot;!\n&quot;);<br><br>&nbsp; &nbsp;return(0);<br>}<br>
<br>And add this to your command table:<br><br>@commandtable = (<br>&nbsp; &nbsp; &nbsp; &nbsp;{&#39;show inventory raw&#39; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; &#39;ShowInventory&#39;},<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>&nbsp; &nbsp; &nbsp; &nbsp;From: Yuval Ben Ari [mailto:<a href="mailto:yuval.ben.ari@gmail.com" target="_blank">yuval.ben.ari@gmail.com</a>]<br>&nbsp; &nbsp; &nbsp; &nbsp;Sent: Sunday, March 02, 2008 9:13 AM<br>
&nbsp; &nbsp; &nbsp; &nbsp;To: Elliott, Andrew<br>&nbsp; &nbsp; &nbsp; &nbsp;Cc: <a href="mailto:rancid-discuss@shrubbery.net" target="_blank">rancid-discuss@shrubbery.net</a><br>&nbsp; &nbsp; &nbsp; &nbsp;Subject: Re: [rancid] Re: GSR 12k - sho diag / missing subslot<br>spa info<br>

<div>
<div></div>
<div><br><br>&nbsp; &nbsp; &nbsp; &nbsp;I am also having the same problem, and I am also interested to<br>have the S/N of the SPA<br>&nbsp; &nbsp; &nbsp; &nbsp;Indeed &quot;show inventory&quot; seems the best way to do it.<br>&nbsp; &nbsp; &nbsp; &nbsp;has anyone added &quot;show inventory&quot; parser yet?<br>
&nbsp; &nbsp; &nbsp; &nbsp;otherwise I can try to add it and post here.<br><br>&nbsp; &nbsp; &nbsp; &nbsp;Yuval<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp;On Wed, Jun 27, 2007 at 10:50 PM, Elliott, Andrew<br>&lt;<a href="mailto:AElliott@xo.com" target="_blank">AElliott@xo.com</a>&gt; wrote:<br>
<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; Hello,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; I have been recently asked that my router backups<br>include<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; the SUBSLOT<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; line from &#39;sho diag&#39; on the 12k&#39;s.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; Here is an example (trimmed for brevity) of the<br>output I<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; want rancid to<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; parse:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; SLOT 1 &nbsp;(RP/LC 1 ): Modular SPA Interface Card (10G)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; -snip-<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; &nbsp; SPA Information:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; subslot 1/0: SPA-10X1GE-V2 (0x508), status<br>is ok<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; subslot 1/1: Empty<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; subslot 1/2: Empty<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; subslot 1/3: Empty<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; SUBSLOT &nbsp;1/0 (SPA-10X1GE-V2): 10-port Gigabit<br>Ethernet Shared Port<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; Adapter<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; Product Identifier (PID) : SPA-10X1GE-V2<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; -snip-<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; This is a new card type that we have recently begun<br>
deploying, and<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; currently all that is backed up is the main SPA IC<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; information, not the<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; info on the &quot;SUBSLOT&quot; or &quot;SPA -&gt; subslot&quot; lines.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; I&#39;d need to have the complete output; I don&#39;t have<br>GSRs anymore.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHR1.NYC-NY#sho diag 1<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SLOT 1 &nbsp;(RP/LC 1 ): Modular SPA Interface Card (10G)<br>
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MAIN: type 149, &nbsp;00-0000-00 rev A0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Deviation: &nbsp;D090170<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HW config: 0x20 &nbsp; &nbsp;SW key: 00-00-00<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PCA: &nbsp;00-00000-00 rev A0 ver 4<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Design Release 1.0 &nbsp;S/N SAD000000M0<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MBUS: Embedded Agent<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Test hist: 0x00 &nbsp; &nbsp;RMA#: 00-00-00 &nbsp; &nbsp;RMA hist:<br>0x00<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DIAG: Test count: 0x00000000 &nbsp; &nbsp;Test results:<br>0x00000000<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FRU: &nbsp;Linecard/Module: 12000-SIP-601=<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Processor Memory: MEM-LC5-2048=(Non-Replaceable)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Packet Memory: MEM-LC5-PKT-256=(Non-Replaceable)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; L3 Engine: 5 - ISE 10 Gbps<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MBUS Agent Software version 2.51 (RAM) (ROM version is<br>
3.50)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ROM Monitor version 17.1<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Fabric Downloader version used 4.1 (ROM version is 4.1)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Primary clock is CSC 1<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Board is analyzed<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Board State is Line Card Enabled (IOS &nbsp;RUN )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Insertion time: 00:22:52 (2w4d ago)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Processor Memory size: 2147483648 bytes<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TX Packet Memory size: 268435456 bytes, Packet Memory<br>pagesize: 32768<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bytes<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX Packet Memory size: 268435456 bytes, Packet Memory<br>pagesize: 32768<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bytes<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 crashes since restart<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SPA Information:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subslot 1/0: SPA-10X1GE-V2 (0x508), status is ok<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subslot 1/1: Empty<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subslot 1/2: Empty<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subslot 1/3: Empty<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHR1.NYC-NY#<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; It is possible I am using a version of rancid that<br>
needs to<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; be upgraded<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; &gt; and/or patched.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; possibly. &nbsp;&#39;show inventory&#39; has been added and that<br>ought to<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; include this<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; information...if cisco has gotten around to adding it<br>to this platform<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt; yet.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt;<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Looks like this might be the best way to go. &nbsp;From the<br>
show inventory:<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NAME: &quot;slot 1&quot;, DESCR: &quot;ISE 10G Modular Services Card<br>v2&quot;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PID: 12000-SIP-601 &nbsp; &nbsp; , VID: V02, SN: SAD111403M0<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NAME: &quot;SPA subslot 1/0&quot;, DESCR: &quot;10-port Gigabit<br>
Ethernet Shared Port<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Adapter&quot;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PID: SPA-10X1GE-V2 &nbsp; &nbsp; , VID: V01, SN: JAB111701NG<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_______________________________________________<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rancid-discuss mailing list<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:Rancid-discuss@shrubbery.net" target="_blank">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></div></div></blockquote></div><br>