Discussion:
[rancid] ignoring DHCP database files in flash
Lee
2010-10-06 18:39:06 UTC
Permalink
The DHCP database files weren't being ignored on c2800 routers:

@@ -25,13 +25,13 @@
!Flash: 8 194060 Jan 24 2009 02:19:30 atro_main2.au
!Flash: 10 322058 Jan 30 2010 00:58:38 atro_aa.au
!Flash: 11 462058 Apr 02 2010 15:16:38 atro_aa_4_2.au
!Flash: 12 384058 May 07 2010 23:00:40 atro_aa_5_7.au
!Flash: 13 59478200 Jun 03 2010 23:44:28
c2800nm-adventerprisek9-mz.124-24.T3.bin
!Flash: 14 384058 May 17 2010 23:37:08 ATRO_AA_5_17.au
- !Flash: 15 4235 Oct 06 2010 09:37:44 dhcp_database.txt
+ !Flash: 15 4235 Oct 06 2010 16:18:50 dhcp_database.txt

sub ShowFlash also needs to ignore DHCP database files:

diff -U 6 rancid-2.3.5/bin/rancid ~/rancid/bin/rancid
--- rancid-2.3.5/bin/rancid 2010-09-23 10:58:12.000000000 -0400
+++ ~/rancid/bin/rancid 2010-10-06 13:22:37.000000000 -0400
@@ -695,12 +695,13 @@
print STDERR " In ShowFlash: $_" if ($debug);

while (<INPUT>) {
tr/\015//d;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/dhcp[-_]database/); ;# --LR--
return(1) if ($type =~ /^(12[40]|7)/);
return(1) if (/^\s*\^\s*$/);
return(1) if (/Line has invalid autocommand /);
return(1) if (/(Invalid (input|command) detected|Type help or )/i);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX

Lee
john heasley
2010-10-06 22:40:38 UTC
Permalink
Post by Lee
@@ -25,13 +25,13 @@
!Flash: 8 194060 Jan 24 2009 02:19:30 atro_main2.au
!Flash: 10 322058 Jan 30 2010 00:58:38 atro_aa.au
!Flash: 11 462058 Apr 02 2010 15:16:38 atro_aa_4_2.au
!Flash: 12 384058 May 07 2010 23:00:40 atro_aa_5_7.au
!Flash: 13 59478200 Jun 03 2010 23:44:28
c2800nm-adventerprisek9-mz.124-24.T3.bin
!Flash: 14 384058 May 17 2010 23:37:08 ATRO_AA_5_17.au
- !Flash: 15 4235 Oct 06 2010 09:37:44 dhcp_database.txt
+ !Flash: 15 4235 Oct 06 2010 16:18:50 dhcp_database.txt
diff -U 6 rancid-2.3.5/bin/rancid ~/rancid/bin/rancid
--- rancid-2.3.5/bin/rancid 2010-09-23 10:58:12.000000000 -0400
+++ ~/rancid/bin/rancid 2010-10-06 13:22:37.000000000 -0400
@@ -695,12 +695,13 @@
print STDERR " In ShowFlash: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/dhcp[-_]database/); ;# --LR--
rancid 2.3.5 already ignores

if (/dhcp_[^. ]*\.txt/) {
Post by Lee
return(1) if ($type =~ /^(12[40]|7)/);
return(1) if (/^\s*\^\s*$/);
return(1) if (/Line has invalid autocommand /);
return(1) if (/(Invalid (input|command) detected|Type help or )/i);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
Lee
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Lee
2010-10-07 20:45:42 UTC
Permalink
Post by john heasley
Post by Lee
@@ -25,13 +25,13 @@
!Flash: 8 194060 Jan 24 2009 02:19:30 atro_main2.au
!Flash: 10 322058 Jan 30 2010 00:58:38 atro_aa.au
!Flash: 11 462058 Apr 02 2010 15:16:38 atro_aa_4_2.au
!Flash: 12 384058 May 07 2010 23:00:40 atro_aa_5_7.au
!Flash: 13 59478200 Jun 03 2010 23:44:28
c2800nm-adventerprisek9-mz.124-24.T3.bin
!Flash: 14 384058 May 17 2010 23:37:08 ATRO_AA_5_17.au
- !Flash: 15 4235 Oct 06 2010 09:37:44 dhcp_database.txt
+ !Flash: 15 4235 Oct 06 2010 16:18:50 dhcp_database.txt
diff -U 6 rancid-2.3.5/bin/rancid ~/rancid/bin/rancid
--- rancid-2.3.5/bin/rancid 2010-09-23 10:58:12.000000000 -0400
+++ ~/rancid/bin/rancid 2010-10-06 13:22:37.000000000 -0400
@@ -695,12 +695,13 @@
print STDERR " In ShowFlash: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
+ next if (/dhcp[-_]database/); ;# --LR--
rancid 2.3.5 already ignores
if (/dhcp_[^. ]*\.txt/) {
Which is why I included an example of the file "dhcp_database.txt"
showing up in the change log. rancid 2.3.5 has
Post by john heasley
if (/dhcp_[^. ]*\.txt/) {
only in sub DirSlotN - you need another test for ignoring dhcp files
in sub ShowFlash

Regards,
Lee

Loading...