[rancid] excluding output from cisco routers and switches relating to Flash: bootflash:

Ian Stong istong at costar.com
Thu Jan 14 12:21:36 UTC 2016


I'm running an older version of rancid and was wondering if there is something I can edit to prevent the daily emails for changes I don't care about as mentioned below.  I edited rancid and tried excluding various model routers giving me the unwanted output (return(1) if ($type =~ /^(12[40]|7|4|2|1)/);) but it didn't change anything

# This routine parses "show flash"
sub ShowFlash {
    # skip if this is 7000, 7200, 7500, or 12000; else we end up with
    # redundant data from dir /all slot0:
    print STDERR "    In ShowFlash: $_" if ($debug);

    while (<INPUT>) {
        tr/\015//d;
        last if (/^$prompt/);
        next if (/^(\s*|\s*$cmd\s*)$/);
        return(1) if ($type =~ /^(12[40]|7|4|2|1)/);
        return(-1) if (/command authorization failed/i);
        return(1) if /^\s*\^\s*$/;
        return(1) if /(Invalid input detected|Type help or )/;
        # the pager can not be disabled per-session on the PIX
        s/^<-+ More -+>\s*//;
        /\s+vlan\.dat$/ && next;
        ProcessHistory("FLASH","","","!Flash: $_");
    }
    ProcessHistory("","","","!\n");
    return; 



-----Original Message-----
From: Rancid-discuss [mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of heasley
Sent: Monday, January 11, 2016 6:03 PM
To: Alan McKinnon
Cc: rancid-discuss at shrubbery.net
Subject: Re: [rancid] excluding output from cisco routers and switches relating to Flash: bootflash:

Sun, Jan 03, 2016 at 06:24:34PM +0200, Alan McKinnon:
> On 03/01/2016 16:50, Ian Stong wrote:
> > Hi,
> > 
> >  
> > 
> > I need to exclude the following output from rancid as it always 
> > shows changes to the Flash: bootflash:
> > 
> >  
> > 
> > Sample below of what it is seeing as a change
> > 
> >  
> > 
> > - !Flash: bootflash: 273633  drwx             8192  Dec 31 2015 06:27:53
> > -04:00  tracelogs
> > 
> > + !Flash: bootflash: 273633  drwx             8192  Dec 31 2015 13:55:48
> > -04:00  tracelogs
> 
> 
> modify the perl code with a suitable regex to detect the line you want 
> removed. The form is usually something like this:
> 
> next if /insert some regex here/;
> 
> The code is peppered with 10s of examples, and the question has been 
> asked and answered many times here. It's somewhat of an FAQ.

There already is a filter for this w/ ios-xe, which had a bug in some old version causing this to endlessly change.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss at shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss


More information about the Rancid-discuss mailing list