[rancid] Re: ignore certain diff's

Ryan Speed rspeed at gmail.com
Mon Jun 12 16:41:34 UTC 2006


just to follow-up for completeness.

Thanks Dave,

your suggestion worked with minor modification, I made the changes and
forgot about it (mainly because I stopped receiving the bogus emails).

I changed --ignore-matching-lines='^call-forward' to
--ignore-matching-lines='.*call-forward.*' which has filtered out the
call forwarding emails I was receiving.

Thanks again,
Ryan

On 5/24/06, David LaPorte <david_laporte at harvard.edu> wrote:
> We do something similar to ignore access-list changes.  It's more
> in-depth than simply grep'ing it (since there are context lines as well
> you don't want to see), but hacking control_rancid as follows should work:
>
> cvs -f diff -U 4 | sed -e '/^RCS file: /d' -e '/^--- /d' \
>         -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
>
> to:
>
> cvs -f diff -U 4 --ignore-matching-lines='^call-forward' | sed -e '/^RCS
> file: /d' -e '/^--- /d' -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
>
> For some reason, I seem to remember it would still email even if the
> diff were blank, so I wrapped the email section in a:
>
> DIFF=`cat $TMP.diff | grep -v "^===" | grep -v "^diff " | grep -v
> "^Index: " | grep -v "^retrieving revision" | grep -v "^$"`
>     if [ -n "$DIFF" ]; then
> ...email stuff here...
> fi
>
> There may be a better way, but that has worked well for me.
>
> Dave
>
> Ryan Speed wrote:
> > Howdy,
> >
> > I've got rancid checking a few cisco routers running Callmanager
> > Express which has turned out to be a bit of an annoyance because when
> > people forward their phones I get the diff emails sent out.  Before I
> > go hacking away at the scripts could someone suggest an elegant way to
> > add exceptions to the emailing of diffs?  I'm assuming a | grep -v
> > call-forward in the right place would do the trick.
> >
> > Thanks,
> > Ryan
> >
>


-- 
><(((°>
Ryan Speed
http://speedo.ca (Personal site)
http://gallery.speedo.ca (Photo Gallery)
http://newsbc.ca (News BC)
http://newsbc.ca/movies (Movie Reviews)



More information about the Rancid-discuss mailing list