On Tue, Feb 15, 2011 at 4:51 PM, Nigel Kersten <[email protected]> wrote:
> On Tue, Feb 15, 2011 at 6:55 AM, Rus Hughes <[email protected]> wrote:
>> Hi,
>>
>> We'd like to run puppet regularly in noop then trigger an event after
>> the run depending on the results, namely to hook puppet in to our
>> Nagios implementation so that if anything changes for any reason we
>> receive an alert.
>>
>> We already have puppet configured to send out puppet reports via email
>> but don't want to completely rely on that.
>>
>> Is it possible to craft a trigger of some sort so that after a run we
>> can run a shell script which goes 'ok, nothing has changed, send
>> nagios an OK' or 'omg changes,
>> send nagios a CRITICAL and wake everyone up' ?
>
> It sounds like you're looking for a postrun_command ?
>
> # A command to run after every agent run. If this command returns a non-zero
> # return code, the entire Puppet run will be considered to have
> failed, even though it might have
> # performed work during the normal run.
> # The default value is ''.
> # postrun_command =
>
> Or perhaps even more simply, set up reporting so you can mine the
> structured report data for status information.
Yeah I twigged just after posting that a report is probably the best
way to do this so i can analyze the results
at the moment I have this :
require 'puppet'
Puppet::Reports.register_report(:nagios) do
Puppet.settings.use(:reporting)
desc "Sends reports directly to Nagios"
def process
begin
exec "/usr/lib/nagios/eventhandlers/submit_puppet_result
10.30.0.101 puppet-report 0 \"There has been no change\""
end
end
end
http://pastie.org/1567064 in case email formatting munges things
and i've configured puppetmasterd like so
reports = log, store, rrdgraph, smt, tagmail, nagios
but when I do a puppet run I get
2011-02-15T17:00:24.00+00:00 vfantmon1 puppetmasterd[28860]: Report
nagios failed: no block given
any idea what i've done wrong?
Thanks,
Rus
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.