Discussion:
[rancid] The annoyance of whitespace changes.
Will Miller
2007-10-17 17:28:08 UTC
Permalink
Hey guys, I'm a newcomer, so be gentle.

I've looked high and low for a solution to this, but to no avail-- hence
my adding to your inboxes.

So, here's my problem. I have a device (specifically a firewall
services module in a 6509) being monitored by rancid. Much to
frequently, though (on the order of a few times a day), I get config
diffs mailed to me that contain a bunch of changes like this:

@@ -500,9 +500,9 @@
port-object eq 27002
port-object eq 27003
port-object eq 27004
port-object eq 27005
- port-object eq 27006
+ port-object eq 27006
port-object eq 27007
port-object eq 27008
port-object eq 27009
port-object eq 27010

Note that the only thing that changed is the whitespace before the
command.

Try as I might, I can't figure out a workaround. I tried modifying
control_rancid from "cvs -f diff -U 4" to "cvs -f diff -w -U 4". This,
however, didn't change the number of emails coming in. It still printed
the header with no diffs listed:

Index: configs/<IP>
===================================================================
retrieving revision 1.240
diff -w -U4 -r1.240 <IP>

(Yeah, that was revision 240... no, we don't change the config quite
that often.)

So, any of you have any ideas why this might be happening or, failing
that, how I might work around it?

Thanks for any help,
--
Will
Lance
2007-10-17 19:12:44 UTC
Permalink
Will,

A crude but functional method might be to remove all starting whitespace
on each line before you write to the file. That will make your cvs check
not a problem. :-D

-Lance
-------- Original Message --------
Date: Wed, October 17, 2007 10:28 am
Hey guys, I'm a newcomer, so be gentle.
I've looked high and low for a solution to this, but to no avail-- hence
my adding to your inboxes.
So, here's my problem. I have a device (specifically a firewall
services module in a 6509) being monitored by rancid. Much to
frequently, though (on the order of a few times a day), I get config
@@ -500,9 +500,9 @@
port-object eq 27002
port-object eq 27003
port-object eq 27004
port-object eq 27005
- port-object eq 27006
+ port-object eq 27006
port-object eq 27007
port-object eq 27008
port-object eq 27009
port-object eq 27010
Note that the only thing that changed is the whitespace before the
command.
Try as I might, I can't figure out a workaround. I tried modifying
control_rancid from "cvs -f diff -U 4" to "cvs -f diff -w -U 4". This,
however, didn't change the number of emails coming in. It still printed
Index: configs/<IP>
===================================================================
retrieving revision 1.240
diff -w -U4 -r1.240 <IP>
(Yeah, that was revision 240... no, we don't change the config quite
that often.)
So, any of you have any ideas why this might be happening or, failing
that, how I might work around it?
Thanks for any help,
--
Will
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Gee-clough, Aaron (NIH/CIT) [C]
2007-10-18 13:04:12 UTC
Permalink
This is happening because the regex that deals with the pager on the
FWSM (and PIX and ASA) is eating the indentation along with the "<--
More -->" characters from the pager. (Where in the config the pager
will occur chagnes with the length of the config, leading to lots of
cascading changes when you change a line in the middle of the config.)
Try turning off the pager. That should make these go away.

aaron
-----------------
Aaron Gee-Clough
CIT/DNST/NEB/NSS
Contractor. Geek.
-----Original Message-----
From: Will Miller [mailto:***@gtri.gatech.edu]
Sent: Wednesday, October 17, 2007 1:28 PM
To: rancid-***@shrubbery.net
Subject: [rancid] The annoyance of whitespace changes.

Hey guys, I'm a newcomer, so be gentle.

I've looked high and low for a solution to this, but to no avail-- hence

my adding to your inboxes.

So, here's my problem. I have a device (specifically a firewall
services module in a 6509) being monitored by rancid. Much to
frequently, though (on the order of a few times a day), I get config
diffs mailed to me that contain a bunch of changes like this:

@@ -500,9 +500,9 @@
port-object eq 27002
port-object eq 27003
port-object eq 27004
port-object eq 27005
- port-object eq 27006
+ port-object eq 27006
port-object eq 27007
port-object eq 27008
port-object eq 27009
port-object eq 27010

Note that the only thing that changed is the whitespace before the
command.

Try as I might, I can't figure out a workaround. I tried modifying
control_rancid from "cvs -f diff -U 4" to "cvs -f diff -w -U 4". This,
however, didn't change the number of emails coming in. It still printed

the header with no diffs listed:

Index: configs/<IP>
===================================================================
retrieving revision 1.240
diff -w -U4 -r1.240 <IP>

(Yeah, that was revision 240... no, we don't change the config quite
that often.)

So, any of you have any ideas why this might be happening or, failing
that, how I might work around it?

Thanks for any help,
--
Will
Will Miller
2007-11-28 14:57:55 UTC
Permalink
Post by Will Miller
Hey guys, I'm a newcomer, so be gentle.
I've looked high and low for a solution to this, but to no avail-- hence
my adding to your inboxes.
So, here's my problem. I have a device (specifically a firewall
services module in a 6509) being monitored by rancid. Much to
frequently, though (on the order of a few times a day), I get config
@@ -500,9 +500,9 @@
port-object eq 27002
port-object eq 27003
port-object eq 27004
port-object eq 27005
- port-object eq 27006
+ port-object eq 27006
port-object eq 27007
port-object eq 27008
port-object eq 27009
port-object eq 27010
Note that the only thing that changed is the whitespace before the
command.
Try as I might, I can't figure out a workaround. I tried modifying
control_rancid from "cvs -f diff -U 4" to "cvs -f diff -w -U 4". This,
however, didn't change the number of emails coming in. It still printed
Index: configs/<IP>
===================================================================
retrieving revision 1.240
diff -w -U4 -r1.240 <IP>
(Yeah, that was revision 240... no, we don't change the config quite
that often.)
So, any of you have any ideas why this might be happening or, failing
that, how I might work around it?
Thanks for any help,
--
Will
Old topic, I know, but here's how I worked around it. I took Lance's
suggestion and just pulled out leading whitespace from all configs.
Diff between the original and modified versions of control_rancid:

361c361,363
< mv $router.new $router
---
Post by Will Miller
#mv $router.new $router
cat $router.new | sed -e 's/^ *//g' > $router
rm -f $router.new
Admittedly not the most elegant solution--and not even implemented very
well, but it does what I wanted which is to mute all the false differences.

It's been a while, but I'm fairly sure I tried Aaron's suggestion about
killing the pager, but either I didn't do it right or it didn't do what
was wanted, so I went this route.
--
Will
Loading...