Re: [rancid] router config diffs

Wayne Eisenberg <[email protected]>
Newsgroups gmane.network.rancid
Message-ID <[email protected]>
Thanks, that's an interesting idea although what I was really thinking of was turning off the emailing of diffs, not totally disabling mail. (It would still be important to know if rancid lost contact with devices.)
If that were part of the official control_rancid, then it could be controlled by a variable in the rancid.conf file. Just a newbie idea.


-----Original Message-----
From: Lee [mailto:[email protected]]
Sent: Thursday, October 25, 2018 4:17 AM
To: Wayne Eisenberg <[email protected]>
Cc: [email protected]
Subject: Re: [rancid] router config diffs

On 10/25/18, Wayne Eisenberg <[email protected]> wrote:
>> 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)?

For a global switch just use your version of sendmail instead of the system version:
$ cat sendmail
#!/bin/sh
#
# rancid insists on having sendmail
# so give it one
#
echo ""      >> /tmp/sendmail.txt
date         >> /tmp/sendmail.txt
echo "$*"    >> /tmp/sendmail.txt
while read LINE
do
  echo $LINE >> /tmp/sendmail.txt
done
echo ""      >> /tmp/sendmail.txt

altho you'd probably want it to be just
exit

and if you ever want rancid to actually send mail, have your sendmail be a link to the real one.

Regards,
Lee


________________________________

The information in this Internet e-mail (and any attachments) is confidential, may be legally privileged and is intended solely for the Addressee(s) named above. If you are not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, then any dissemination or copying of this e-mail (and any attachments) is prohibited and may be unlawful. If you received this e-mail in error, please immediately notify us by e-mail or telephone, then delete the message. Thank you.
_______________________________________________
Rancid-discuss mailing list
[email protected]
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.