[rancid] Re: Problem gathering data from an updated ERX junose

Mark Loveley mloveley at plus.net
Tue Oct 2 10:44:08 UTC 2007


On 2 Oct 2007, at 09:05, Sven Juergensen (KielNET) wrote:

> hi list,
>
> i'm experiencing issues with collecting
> data from a juniper erx. the device was
> updated from 5.x to 8.x the day before.
>
> logs result the following:
>
> ---8<---
> Trying to get all of the configs.
> <router>: missed cmd(s): show configuration,show hardware,dir
> <router>: End of run not found
> ! srp redundancy: mode is high-availability, state active
> =====================================
> --->8--

Between versions 5 and 8 the output of "show env" changed. Currently  
we use version 7 code and my changes are below, your milage may vary  
depending on how your ERX is configured (ie dual SRPs/fileSync/HA  
etc), we now run a HA setup, pre 7 we used fileSync.

I fixed it for us by editing the "sub ShowEnv" subroutine in the  
jerancid script to look like this.

> # This routine parses "show environment all"
> sub ShowEnv {
>     print STDERR "    In ShowEnv: $_" if ($debug);
>     my $autoSyncEna = 0;                # assume auto-sync is disabled
>
>     while (<INPUT>) {
>         tr/\015//d;
>         last if (/^$prompt/);
>         next if (/^(\s*|\s*$cmd\s*)$/);
>         next if (/^Please wait/i);
>         return(-1) if (/command authorization failed/i);
>         # is autoSync enabled?
>         $autoSyncEna =1 if (/enabled, switch-on-error  
> enabled/);        # pre 7 code
>         $autoSyncEna =1 if (/auto-sync  
> enabled/);                       # post 7 code
>         # fail if the RP is amid the auto-sync process
>         return(-1) if (($autoSyncEna == 1) && (/out of sync \(file  
> system\)/)); # pre 7 code
>         return(-1) if (($autoSyncEna == 1) && (/sync in  
> progress/));            # post 7 code
>         #return(-1) if (/auto-sync enabled/ && !/in sync/);
>
>         # skip the temperature goop
>         if (/processor\s+processor/) {
>              <INPUT>; <INPUT>; <INPUT>;
>              next;
>         }
>         /^\d+\s+\d+\s+\S+/ && next;
>         # skip the temperature on a E320
>         if (/temperature\s+temperature/) {
>              <INPUT>; <INPUT>;
>              next;
>         }
>         /^\d+\s+\w+-\d+\s+\d+\s+\S+/ && next;
>         /^\d+\/\d+\s+\w+[-\d+]*\sIOA\s+\d+\s+\S+/ && next;
>
>         # strip nvs usage
>         s/, \d+% \S+\)/\)/;
>
>         s/^    //;
>         ProcessHistory("COMMENTS","keysort","D1","! $_");
>     }
>     ProcessHistory("COMMENTS","keysort","D1","!\n");
>     return(0);
> }

Also under DirSlotN I found the need to add a extra regex to avoid  
false diffs.

>         # fail if the RP is amid the auto-sync process
>         return(-1) if (/active\/standby/i && /not sync/);
>         return(-1) if (/active\/standby/i && /being sync/);

These changes have avoided 99% of the false diffs for me.

HTH
-- 
| Mark Loveley                                  Broadband Solutions for
| Network Engineer                                    home and business
| PlusNet PLC                                             @www.plus.net
| Registered Office: Internet House, 2 Tenter Street, Sheffield, S1 4BY
| Registered in England no: 3279013
+ ------------ PlusNet - The smarter way to broadband ----------------+





More information about the Rancid-discuss mailing list