eventhandler timeout 3.0.4
Ton Voon
ton.voon at opsera.com
Fri Oct 31 09:00:46 CET 2008
Hi Sven,
On 30 Oct 2008, at 15:49, Sven Nierlein wrote:
> Ah, i had a look, but didn't found your post before.
> Solution #1 doesn't work, if i start my eventhandler
> in background, nagios still waits for the eventhandler to
> finish.
You probably have an open filehandle, which causes the parent to still
wait for the script to finish. Look at daemonising examples.
> So, in my opinion, there are 2 problems with eventhandler/
> notifications.
>
> 1. They are executed sequentially and blocking nagios while executed
> 2. nagios runs amok when the eventhandler gets into an early_timeout
> because the main process
> wants to read from the killed pipe in a never ending loop.
>
> I wrote a small patch for the second issue, maybe someone with more
> c skills wants to have a look...
We saw a similar issue for notifications - thanks for your patch. I've
made a few modifications, attached. I don't know how you got it to
work because in your if statement, bytes_read would never be -1.
I've put the whole "reading output" section as an else, so we ignore
processing of the output if a timeout is considered.
I've also updated the debugging so that it prints the output
regardless of whether the calling function wants it or not, which
should help debugging.
BTW, if a SIGHUP or a SIGINT signal is sent while Nagios has a set of
notification commands for a list of contacts because of a host/service
alert, the signal is not processed until all those notification
commands have been completed. There probably should be a break
somewhere in that list. Another reason to make sure your notification
commands are quick!
Ton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios_stop_notification_timeouts_spinning.patch
Type: application/octet-stream
Size: 2996 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20081031/b8024dcc/attachment.obj>
-------------- next part --------------
-------------- 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-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel
More information about the Developers
mailing list