Page 1 of 1

Re: [Nagios-devel] add eventhandler override

Posted: Fri Sep 17, 2010 1:41 pm
by Guest
Hi,

Sven Nierlein wrote:
> Currently eventhandlers are executed in the main thread of nagios and block the core until the eventhandler is finished.
> Attached is a patch, which makes it possible for eventhandling neb modules to cancel/override the execution of eventhandlers.
> This is currently only possible with service and host checks. This patch would allow neb modules to stack eventhandlers on
> external queues or even distribute execution of eventhandler.
> This patch should not break the behavior of current neb modules, because their return value is currently ignored and
> execution of eventhandler will only be canceled on returning "NEBERROR_CALLBACKOVERRIDE".
>

changing the overall return value of broker_event_handler from void to
int also requires some more return values. see diff git against current
master below.

Kind regards,
Michael



diff --git a/base/broker.c b/base/broker.c
index 8c0bdd2..f99fc90 100644
--- a/base/broker.c
+++ b/base/broker.c
@@ -184,10 +184,10 @@ int broker_event_handler(int type, int flags, int
attr, int eventhandler_type, v
int return_code=OK;

if(!(event_broker_options & BROKER_EVENT_HANDLERS))
- return;
+ return OK;

if(data==NULL)
- return;
+ return ERROR;

/* get command name/args */
if(cmd!=NULL){




--
DI (FH) Michael Friedrich

Vienna University Computer Center
Universitaetsstrasse 7 A-1010 Vienna, Austria

email: [email protected]
phone: +43 1 4277 14359
fax: +43 1 4277 14279
web: http://www.univie.ac.at/zid

Icinga Core& IDOUtils Developer
http://www.icinga.org






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]