Discussion:
[rancid] excluding output from cisco routers and switches relating to Flash: bootflash:
Ian Stong
2016-01-03 14:50:32 UTC
Permalink
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





Thanks
Alan McKinnon
2016-01-03 16:24:34 UTC
Permalink
Post by Ian Stong
Hi,
I need to exclude the following output from rancid as it always shows
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.
--
Alan McKinnon
***@gmail.com
heasley
2016-01-11 23:02:57 UTC
Permalink
Post by Alan McKinnon
Post by Ian Stong
Hi,
I need to exclude the following output from rancid as it always shows
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
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.
Ian Stong
2016-01-14 12:21:36 UTC
Permalink
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-***@shrubbery.net] On Behalf Of heasley
Sent: Monday, January 11, 2016 6:03 PM
To: Alan McKinnon
Post by Alan McKinnon
Post by Ian Stong
Hi,
I need to exclude the following output from rancid as it always
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
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.
Lee
2016-01-14 15:54:10 UTC
Permalink
Post by Ian Stong
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
What I had in rancid 2.8:

# 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);
$redacted = 0; # -LR- set if a file listing is suppressed

while (<INPUT>) {
tr/\015//d;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
### -LR- ideal would be to ignore filesystem changes like date
& time, but I'm not there yet
### -LR- so ignore the whole thing
if (/startup-config\s*$/) {$redacted = 1; next; } # -LR-
if (/private-config\.text\s*$/) {$redacted = 1; next; } # -LR-
if (/config\.text\s*$/) {$redacted = 1; next; } # -LR-
if (/dhcp[-_]database\s*$/) {$redacted = 1; next; } # -LR-
ignore dhcp database changes
if (/dhcp-snooping(-data)?\s*$/){$redacted = 1; next; } # -LR-
ignore dhcp snooping database changes
if (/lic_uom\.dat\s*$/) {$redacted = 1; next; } # -LR-
ignore .private/lic_uom.dat changes
if (/.*\(\d+ bytes (free|used)\)/) { # -LR- want to
show bytes used?
if ($redacted) { next; } # -LR- not
when there are files that haven't been shown
} # -LR-


Regards,
Lee
Post by Ian Stong
# This routine parses "show flash"
sub ShowFlash {
# skip if this is 7000, 7200, 7500, or 12000; else we end up with
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-----
Sent: Monday, January 11, 2016 6:03 PM
To: Alan McKinnon
Subject: Re: [rancid] excluding output from cisco routers and switches
Post by Alan McKinnon
Post by Ian Stong
Hi,
I need to exclude the following output from rancid as it always
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
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
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
heasley
2016-01-14 18:57:56 UTC
Permalink
Post by Ian Stong
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
I'd prefer that you upgrade to 3.x. by editing the scripts, I think that
you are making it more difficult for yourself in the future.

f***@iname.com
2016-01-03 19:43:13 UTC
Permalink
What are you tracing that is causing that tracelogs directory to be updated?



Frank



From: Rancid-discuss [mailto:rancid-discuss-***@shrubbery.net] On Behalf Of Ian Stong
Sent: Sunday, January 03, 2016 8:51 AM
To: rancid-***@shrubbery.net
Subject: [rancid] excluding output from cisco routers and switches relating to Flash: bootflash:



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





Thanks
Loading...