Nagios and Logrotate

Andreas Ericsson ae at op5.se
Tue Sep 16 12:30:22 CEST 2008


Andreas Ericsson wrote:
> K-L Reinhard wrote:
>> Mark, thanks a lot for this explanation and the hints. I think I'll have a
>> look at the event broker thing.
>>
> 
> C coding skills are required. For a nudge to get you started, have a look
> at modules/helloworld.c in the nagios source distribution.
> 
> If you don't do it, I'll use this example as the module-writing exercise
> for my Netways presentation. The first to complete it wins a weissbier in
> the hotel bar :-)
> 

Here's the completed thing. I rearranged things a tiny bit, so I had to
write it myself. How to compile is written in the top comment. You pass
it the script you want it to run as argument when loading it in the
nagios.cfg file. Make sure the script runs quickly, because Nagios
will be stalled while it's executing.

Note that on linux, you can achieve the same thing in a better way
using incrond. That won't work for other systems though, as inotify(7)
is a linux specific api.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nebsor.c
Type: text/x-csrc
Size: 636 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080916/475077e7/attachment.c>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list