Event handlers functionality reapplied to Nagios 4

Andreas Ericsson ae at op5.se
Fri Mar 1 16:07:01 CET 2013


On 02/25/2013 04:31 PM, Ton Voon wrote:
> Andreas,
> 
> We've noticed that the event handlers do not currently work in Nagios
> 4 trunk. It seems that there is a FIXME message where the worker part
> was not implemented.
> 

I just tested this, and event handlers work properly here. Granted, my
test only involves running a command that writes a few lines to a file,
so it finishes quickly and never fails.

In what way do you consider them broken?

> We've now implemented this, so I think this is now working as
> expected.
> 
> Please find the patch below, nagios_4_support_event_handlers.patch.
> This applies on top of the envvar support we added for Nagios 4
> (subject "Fix default value for enable_environment_macros") which is
> reattached as nagios_macro_environents_in_command_definition.patch.
> 
> Are there any other things that are not implemented yet that you
> would like some assistance with?
> 

Downtime and comment handling needs a complete rewrite to avoid O(xn)
removal time. A doubly linked list would do the trick. We can add a
fan-out table later. Note that you'll have to do clever tricks with
a container_of() macro to get a doubly linked list without breaking
the ABI though. Using the fact that the first entry of a struct
always has the same address as the struct should do the trick.

The query-handler could use a macro-substitution service.

The existing nerd-channels should take a format-string to replace
macros and whatnot before shipping the data to its subscriber. It
should also print neater output by default.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb




More information about the Developers mailing list