[rancid] How to implement a diff filter?
jean.benoit at crc.u-strasbg.fr
jean.benoit at crc.u-strasbg.fr
Sat Feb 18 00:28:42 UTC 2012
On Fri, Feb 17, 2012 at 08:37:29PM +0000, James Bensley wrote:
[...]
> If that were how Rancid runs, I'd ideally like to insert a call to a
> script in section 3, which would parse the diff to my script. My
> script would look at a folder I have populated with diff's like those
> above, I don't want to be notified about, and not parse them onto to
> the final email that Rancid sends out when a match is found.
>
> Has anyone done this already perhaps?
We do this by redefining PATH to intercept the call to sendmail
in rancid-run :
export PATH=/my/dir:$PATH
rancid-run
A script named sendmail in /my/dir reads stdin and could apply any changes
to the message: add or remove some lines, send an email or not etc.
See:
https://github.com/pdav/netmagis/blob/master/topo/src/start-rancid
https://github.com/pdav/netmagis/blob/master/topo/src/sendmail
--
Jean
More information about the Rancid-discuss
mailing list