[rancid] Re: jerancid show version parsing

Gino Doucet gadoucet at nbnet.nb.ca
Wed Jun 10 15:56:38 UTC 2009


Dave/John,
Not sure if you ever got this resolved but I just noticed it recently and
realized that it affects us as well.  I made some further modifications to
the same line of code that John had initially attempted.  However, here is
what I ended up successfully testing with:

 -	if (/^(\d+ +\S+ +(\S+).*) \S+$/ && $slots) {
 +	if (/^(\d+ +\w+ +(\S+).*) (\S+| -+ +)$/ && $slots) {

As for the slot uptime column I would suggest against including it in your
rancid reports as it continuously changes.  However, if you really want to
have it included and cause a version update every time you run rancid
against your ERX's, modify the line following the above If statement as
follows:

>-  	    my($line) = $1;
>+  	    my($line) = $_;

Cheers,
Gino.


-----Original Message-----
From: rancid-discuss-bounces at shrubbery.net
[mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of Mack, David A
(Dave)
Sent: May 15, 2009 6:46 PM
To: john heasley
Cc: rancid-discuss at shrubbery.net
Subject: [rancid] Re: jerancid show version parsing

John,
	Hello! I applied the patch and did a manual run, but no joy!

Here is cli output:

Juniper Edge Routing Switch E320
Copyright (c) 1999-2008 Juniper Networks, Inc.  All rights reserved.
System Release: e320_9-0-1p0-7-3.rel
        Version: 9.0.1 patch-0.7.3 [BuildId 10622]   (March 8, 2009
21:10)
System running for: 353 days, 2 hours, 34 minutes, 40 seconds
        (since TUE MAY 27 2008 18:15:29 UTC)

slot  state    type    admin  spare   running release     slot uptime  
---- -------- ------- ------- ----- -------------------- --------------
0    standby  LM-10   enabled spare e320_9-0-1p0-7-3.rel      ---      
1     online  LM-4    enabled  ---  e320_9-0-1p0-7-3.rel 16d15h:35m:50s
2      ---      ---     ---    ---          ---               ---      
3     online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel 16d15h:21m:33s
4      ---      ---     ---    ---          ---               ---      
5     online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel 16d15h:21m:09s
6    standby  SRP-320 enabled  ---  e320_9-0-1p0-7-3.rel      ---      
6     online  SFM-320 enabled  ---          ---          16d15h:52m:43s
7     online  SRP-320 enabled  ---  e320_9-0-1p0-7-3.rel 16d15h:52m:51s
7     online  SFM-320 enabled  ---          ---          16d15h:52m:31s
8     online  SFM-320 enabled  ---          ---          16d15h:52m:36s
9     online  SFM-320 enabled  ---          ---          16d15h:52m:24s
10    online  SFM-320 enabled  ---          ---          16d15h:52m:27s
11    online  LM-10   enabled spare e320_9-0-1p0-7-3.rel 10d11h:57m:24s
12    online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel 16d15h:14m:22s
13    online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel 16d15h:13m:30s
14    online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel 16d15h:30m:01s
15    online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel 16d15h:18m:24s
16   inactive LM-10   enabled  ---  e320_9-0-1p0-7-3.rel      ---      

and here is the jerancid output:

!RANCID-CONTENT-TYPE: Juniper_ERX
!
!Chassis type: E320 - a Juniper Edge Routing Switch E320
!
!System Release: e320_9-0-1p0-7-3.rel
!System Version: 9.0.1 patch-0.7.3 [BuildId 10622]   (March 8, 2009
21:10)
!
! slot  state    type    admin  spare   running release    
! ---- -------- ------- ------- ----- --------------------
! 1     online  LM-4    enabled  ---  e320_9-0-1p0-7-3.rel
! 3     online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel
! 5     online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel
! 6     online  SFM-320 enabled  ---          ---         
! 7     online  SRP-320 enabled  ---  e320_9-0-1p0-7-3.rel
! 7     online  SFM-320 enabled  ---          ---         
! 8     online  SFM-320 enabled  ---          ---         
! 9     online  SFM-320 enabled  ---          ---         
! 10    online  SFM-320 enabled  ---          ---         
! 12    online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel
! 13    online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel
! 14    online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel
! 15    online  LM-10   enabled  ---  e320_9-0-1p0-7-3.rel

Thanks!
Dave

______________________________________________________________
David A. Mack                               (703) 391-7787 (W)
CCIE #6963 (SP and R&S) JNCIE-M #399 CISSP  (703) 431-7617 (C)
email:  dmack at verizon.com
______________________________________________________________
"We are now the knights who say... Ping!"
 

> -----Original Message-----
> From: john heasley [mailto:heas at shrubbery.net] 
> Sent: Friday, May 15, 2009 4:30 PM
> To: Mack, David A (Dave)
> Cc: rancid-discuss at shrubbery.net
> Subject: Re: [rancid] jerancid show version parsing
> 
> Fri, May 15, 2009 at 10:32:06AM -0400, Mack, David A (Dave):
> > From the output above you can see that the parsed output is missing 
> > slots 0, 11 and 16. We need to capture those slots as well. 
> As a side 
> > note, the slot uptime is actually useful to us as well. I am not 
> > really very good with PERL, can someone help with this 
> missing output?
> > 
> 
> I think that this patch will fix the missing slots.  Please confirm.
> 
> 
> Index: jerancid.in
> ===================================================================
> RCS file: /home/rancid/.CVS/rancid/bin/jerancid.in,v
> retrieving revision 1.47
> diff -d -u -r1.47 jerancid.in
> --- jerancid.in	4 Mar 2009 19:11:55 -0000	1.47
> +++ jerancid.in	15 May 2009 20:15:53 -0000
> @@ -193,7 +193,7 @@
>  	}
>  	/^(--.*) --+$/ && $slots &&
>  		ProcessHistory("COMMENTS","keysort","B2", "! 
> $1\n") && next;
> -	if (/^(\d+ +\S+ +(\S+).*) \S+$/ && $slots) {
> +	if (/^(\d+\s+\S+\s+(\S+).*) \S+$/ && $slots) {
>  	    my($line) = $1;
>  	    if ($2 != /--+/) {
>  		ProcessHistory("COMMENTS","keysort","B3", "! $line\n");
> 
> 
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss at shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss



More information about the Rancid-discuss mailing list