[rancid] router config diffs

heasley heas at shrubbery.net
Thu Oct 25 22:48:27 UTC 2018


Thu, Oct 25, 2018 at 04:33:45PM -0400, Lee:
> On 10/25/18, heasley <heas at shrubbery.net> wrote:
> > Thu, Oct 25, 2018 at 04:46:48AM +0000, Wayne Eisenberg:
> >> > I'd go with changing control_rancid.  Search for
> >> >
> >> > # Mail out the diffs (if there are any).
> >> > if [ -s $TMP.diff ] ; then
> >>
> >> Bingo. I found my tweak. Thanks, Lee! Instead of actually sending the
> >> email, I had just redirected it to /dev/null.
> >>
> >> -        ) | $SENDMAIL -t $MAILOPTS
> >> +       ) > /dev/null
> >>
> >> Maybe that could be a config choice in rancid.conf (if it were a global
> >> switch) or .cloginrc (if you wanted to turn off mail for specific devices
> >> or groups)?
> >>
> >>
> >> -----Original Message-----
> >> From: Lee [mailto:ler762 at gmail.com]
> >> Sent: Sunday, October 21, 2018 5:46 PM
> >> To: Wayne Eisenberg <Wayne.Eisenberg at CarolinasIT.com>
> >> Cc: rancid-discuss at shrubbery.net
> >> Subject: Re: [rancid] router config diffs
> >>
> >> On 10/21/18, Wayne Eisenberg <Wayne.Eisenberg at carolinasit.com> wrote:
>   <.. snip ..>
> >> > I probably didn't do a good job of explaining. I'm not getting the
> >> > same diff over and over. They are new versions, valid diffs. I don't
> >> > see how svn could get out of sync, when the crontab was inactive
> >> > (everything rem'ed out) so there was no activity during the upgrade.
> >> > Before the upgrade, I know there were router config changes taking
> >> > place and I did not get an email about them. Now I do. So I'm hunting
> >> > for how to turn the notifications off.
> >>
> >> I'd go with changing control_rancid.  Search for
> >
> > why?  there are 3 manners of affecting the same result, but without
> > modifying the installed base and without needing to remember that
> > change following the next upgrade.  embrace the unix
> > methodology - assemble (pipe) simple tools for complex results.
> 
> I haven't tried this, but it sure looks like one could build rancid with
> export SENDMAIL=/usr/local/bin/sendmail_alt
> ./configure --prefix= ..etc..
> 
> and have /usr/local/bin/sendmail_alt be just
> exit

youre making that more difficult than necessary,

export SENDMAIL="dd of=/dev/null bs=32k"

but, you still want the admin email, imiho, and that will break it.

> and that would take care of not sending emails or doing something
> other than sending mail.  Yes?   but that means you'd have to build
> rancid instead of just installing from some repository..
> 
> In any case, I went with changing control_rancid because there were a
> few other things I wanted to do like filtering out passwords, keys,
> hashes, etc. from the mail msg before sending it. So right after the
>   # Diff the directory and then checkin.
> section I added
> 
> # -LR- begin: remove passwords, etc. from diff listing
> /usr/local/bin/sanitize.sh $TMP.diff >$TMP.diff2
> /bin/mv  $TMP.diff2 $TMP.diff
> # -LR- end  : remove passwords etc. from diff listing

this too is possible without changing control_rancid; see rancid.conf(5)
for FILTER_PWDS & DIFFSCRIPT.



More information about the Rancid-discuss mailing list