[rancid] Re: Rancid and Syslog-ng

Daniel Medina daniel.medina at gmail.com
Thu Jul 23 15:37:37 UTC 2009

On Thu, Jul 23, 2009 at 08:09:34AM -0500, Sam Munzani wrote:
> The problem I faced with this approach is when the syslog-ng triggers the 
> program, it memorizes that. So calling rancid-run script directly doesn't 
> work. You need a wrapper script for this directive to work. From the 
> configuration it looks like you have written rancid.pl wrapper. Can you 
> share that to the team?

 Not that it memorizes, but syslog-ng starts the program once and expects it to
hang around, waiting for input.

 In perl (although the syslog-ng example below from Federico handles some of
this already with the filter and template,

    # define your $pattern of interest
    while( <> ) {
        if ( /$pattern/ ) {
            # extract values
            # Do something with your values
            # Like "rancid-run -r device_name"

Note, I've seen it's useful to batch up sysconfig traps or syslog messages
before firing off data collection for every event because you may have humans
logging in manually entering config mode, exiting, re-entering or some other
sort of nonsense :)

Daniel Medina

More information about the Rancid-discuss mailing list