On 03-03-11 08:04, Gabriel Filion wrote:
> On 11-03-02 02:27 PM, Brian Gallew wrote:
>> I've found that Puppet/Naginator has the bad habit of occasionally
>> breaking the Nagios config.  Here's how I worked around this: 1) When
>> you collect your Nagios resource, store them all in a temporary
>> directory (in my case, ~nagios/var/tmp) 2) Purge that directory with
>> a cron job every night (so deleted resources disappear) 3) Create an
>> exec that creates a ~nagios/etc/nagios-tmp.cfg by running sed on
>> ~nagios/etc/nagios.cfg and changing directories appropriately. 4)
>> Create an exec that pre-flights Nagios using the nagios-tmp.cfg
>> (which checks the tmp dir) and, if successful, sync the files over
>> into the real Nagios config directory.
>> 
>> It's a little clunky, but Nagios doesn't ever break anymore.
>> Remember that your pre-flight exec should require all the Nagios
>> resources (so the files get updated first), and should always run if
>> the contents of the tmp dir vary at all from the real target (diff is
>> your friend here).  Otherwise, the preflight may fail once and then
>> never run again until the next time you make a substantive server
>> change.
> 
> hmm, that's an interesting approach. it sounds like it requires a lot
> of exec magic but it does cover for the config breakages and also for 
> purging resources. When I finally get some free time, I'll look into 
> implementing that. Thanks for the hint.

Nice! Currently, our Nagios config lives in a Git repository. Before
pulling changes to /etc/nagios3 and restarting Nagios, we pull them to a
temp dir, and with a nagios.conf with adapted paths, we test the config,
just like you describe. This is all pretty much automated, so it's
something I have been thinking about, how to implement that in Puppet.

Step 3 in your description is -in our setup- unnecessary, we just keep the
test-config in our repo as well.

Thanks.

Best regards,
Martijn.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to