Discussion:
[rancid] Ignoring certain diffs
Eric Cables
2008-11-17 17:39:14 UTC
Permalink
I went through the archives, and implemented one of the solutions for
ignoring diffs (such as call-forward, etc.).

I implemented it as follows in control_rancid:
<-- snippit -->
if [ $RCSSYS = "cvs" ] ; then
DIFFSUPPRESS="-I '.*call-forward.*' -I '.*Flash.*nvram.*'"

cvs -f diff -u -4 -ko $DIFFSUPPRESS \
| sed -e '/^RCS file: /d' -e '/^--- /d' \
-e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
else
svn diff | sed -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
<-- snippit -->


Unfortunately this doesn't seem to have worked. I checked my RANCID e-mail
this morning and it shows the following:

Index: configs/<hostname>
===================================================================
retrieving revision 1.4
diff -u -4 -I ''\''.*call-forward.*'\''' -I ''\''.*Flash.*nvram.*'\''' -r1.4
<hostname> @@ -26,16 +26,16 @@
!Flash: nvram: Directory of nvram:/
- !Flash: nvram: 230 -rw- 7166 <no date>
startup-config
+ !Flash: nvram: 230 -rw- 7127 <no date>
startup-config
!Flash: nvram: 231 ---- 3867 <no date>
private-config
- !Flash: nvram: 232 -rw- 7166 <no date>
underlying-config
+ !Flash: nvram: 232 -rw- 7127 <no date>
underlying-config

It looks like it should have ignored any lines with "Flash: nvram", yet they
are still showing up.

Can anyone please provide a second set of eyes and help me figure out what
I've done wrong?

Thanks,


--
Eric Cables
Eric Cables
2008-11-19 17:09:34 UTC
Permalink
Anyone?
Post by Eric Cables
I went through the archives, and implemented one of the solutions for
ignoring diffs (such as call-forward, etc.).
<-- snippit -->
if [ $RCSSYS = "cvs" ] ; then
DIFFSUPPRESS="-I '.*call-forward.*' -I '.*Flash.*nvram.*'"
cvs -f diff -u -4 -ko $DIFFSUPPRESS \
| sed -e '/^RCS file: /d' -e '/^--- /d' \
-e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
else
svn diff | sed -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
<-- snippit -->
Unfortunately this doesn't seem to have worked. I checked my RANCID e-mail
Index: configs/<hostname>
===================================================================
retrieving revision 1.4
diff -u -4 -I ''\''.*call-forward.*'\''' -I ''\''.*Flash.*nvram.*'\''' -r1.4
!Flash: nvram: Directory of nvram:/
- !Flash: nvram: 230 -rw- 7166 <no date>
startup-config
+ !Flash: nvram: 230 -rw- 7127 <no date>
startup-config
!Flash: nvram: 231 ---- 3867 <no date>
private-config
- !Flash: nvram: 232 -rw- 7166 <no date>
underlying-config
+ !Flash: nvram: 232 -rw- 7127 <no date>
underlying-config
It looks like it should have ignored any lines with "Flash: nvram", yet they
are still showing up.
Can anyone please provide a second set of eyes and help me figure out what
I've done wrong?
Thanks,
--
Eric Cables
Lance Vermilion
2008-11-19 17:47:52 UTC
Permalink
If you don't want the flash stuff you could always very simply remove
it from the collection. Most people that I have seen ask that question
do that.

open the corresponding rancid file "for cisco open:
<rancid_home>/bin/rancid" and then search for "commandtable". Comment
out the commands you don't really care for.

A much more ideal solution would be some nice regex during the
collection period that would remove the file size or date/time stamp.
I don't have time at the moment to look at that, but maybe someone
else does and they can offer it up to John to include.

-Lance
Post by Eric Cables
Anyone?
Post by Eric Cables
I went through the archives, and implemented one of the solutions for
ignoring diffs (such as call-forward, etc.).
<-- snippit -->
if [ $RCSSYS = "cvs" ] ; then
DIFFSUPPRESS="-I '.*call-forward.*' -I '.*Flash.*nvram.*'"
cvs -f diff -u -4 -ko $DIFFSUPPRESS \
| sed -e '/^RCS file: /d' -e '/^--- /d' \
-e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
else
svn diff | sed -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
<-- snippit -->
Unfortunately this doesn't seem to have worked. I checked my RANCID e-mail
Index: configs/<hostname>
===================================================================
retrieving revision 1.4
diff -u -4 -I ''\''.*call-forward.*'\''' -I ''\''.*Flash.*nvram.*'\''' -r1.4
!Flash: nvram: Directory of nvram:/
- !Flash: nvram: 230 -rw- 7166 <no date>
startup-config
+ !Flash: nvram: 230 -rw- 7127 <no date>
startup-config
!Flash: nvram: 231 ---- 3867 <no date>
private-config
- !Flash: nvram: 232 -rw- 7166 <no date>
underlying-config
+ !Flash: nvram: 232 -rw- 7127 <no date>
underlying-config
It looks like it should have ignored any lines with "Flash: nvram", yet they
are still showing up.
Can anyone please provide a second set of eyes and help me figure out what
I've done wrong?
Thanks,
--
Eric Cables
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Eric Cables
2008-11-24 18:02:12 UTC
Permalink
Here is what the e-mail looks like from RANCID, can anyone look at the
syntax and help me figure out what's wrong? Obviously the -I
statements are having no effect (-I '.*Flash.*nvram.*' for example)

diff -u -4 -I ''\''.*call-forward.*'\''' -I ''\''.*Flash.*nvram.*'\'''
-I ''\''.*VTP.*Revision'\''' -I ''\''.*VTP.*MD5'\''' -I
''\''.*Cryptochecksum.*'\''' -r1.3 <hostname.here> @@ -27,15 +27,15 @@
!
!Flash: nvram: Directory of nvram:/
- !Flash: nvram: 469 -rw- 7395 <no date>
startup-config
+ !Flash: nvram: 469 -rw- 7516 <no date>
startup-config
!Flash: nvram: 470 ---- 1934 <no date>
private-config
- !Flash: nvram: 471 -rw- 7395 <no date>
underlying-config
+ !Flash: nvram: 471 -rw- 7516 <no date>
underlying-config
!Flash: nvram: 1 ---- 4 <no date>
rf_cold_starts
!Flash: nvram: 2 -rw- 1922 <no date>
ifIndex-table
!Flash: nvram: 3 ---- 12 <no date>
persistent-data
- !Flash: nvram: 491512 bytes total (478035 bytes free)
+ !Flash: nvram: 491512 bytes total (477914 bytes free)

Here's the snippit of control_rancid that calls the -I statements:
--
DIFFSUPPRESS="-I '.*call-forward.*' -I '.*Flash.*nvram.*' -I '.*VTP.*Revision' -
I '.*VTP.*MD5' -I '.*Cryptochecksum.*'"

cvs -f diff -u -4 -ko $DIFFSUPPRESS \
| sed -e '/^RCS file: /d' -e '/^--- /d' \
-e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
--

-- Eric Cables
Post by Lance Vermilion
If you don't want the flash stuff you could always very simply remove
it from the collection. Most people that I have seen ask that question
do that.
<rancid_home>/bin/rancid" and then search for "commandtable". Comment
out the commands you don't really care for.
A much more ideal solution would be some nice regex during the
collection period that would remove the file size or date/time stamp.
I don't have time at the moment to look at that, but maybe someone
else does and they can offer it up to John to include.
-Lance
Post by Eric Cables
Anyone?
Post by Eric Cables
I went through the archives, and implemented one of the solutions for
ignoring diffs (such as call-forward, etc.).
<-- snippit -->
if [ $RCSSYS = "cvs" ] ; then
DIFFSUPPRESS="-I '.*call-forward.*' -I '.*Flash.*nvram.*'"
cvs -f diff -u -4 -ko $DIFFSUPPRESS \
| sed -e '/^RCS file: /d' -e '/^--- /d' \
-e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
else
svn diff | sed -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
<-- snippit -->
Unfortunately this doesn't seem to have worked. I checked my RANCID e-mail
Index: configs/<hostname>
===================================================================
retrieving revision 1.4
diff -u -4 -I ''\''.*call-forward.*'\''' -I ''\''.*Flash.*nvram.*'\''' -r1.4
!Flash: nvram: Directory of nvram:/
- !Flash: nvram: 230 -rw- 7166 <no date>
startup-config
+ !Flash: nvram: 230 -rw- 7127 <no date>
startup-config
!Flash: nvram: 231 ---- 3867 <no date>
private-config
- !Flash: nvram: 232 -rw- 7166 <no date>
underlying-config
+ !Flash: nvram: 232 -rw- 7127 <no date>
underlying-config
It looks like it should have ignored any lines with "Flash: nvram", yet they
are still showing up.
Can anyone please provide a second set of eyes and help me figure out what
I've done wrong?
Thanks,
--
Eric Cables
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Loading...