Event Handlers are not runing or logging. (on WARNING or CRITICAL)

Bruce bruce at webfarm.co.nz
Fri Sep 3 01:10:10 CEST 2004


Hi,

Please see the response to your reply below,

Cook, Garry wrote:

>nagios-users-admin at lists.sourceforge.net wrote:
>  
>
>>Hi,
>>
>>I think my email is not working correctly because im not getting
>>responses to my questions until I post a follow up (very weird)
>>
>>Has anyone had any thoughts on my findings below?
>>
>>Just to refresh the issue,
>>Originally I thought Event handlers were not running, however I have
>>since found that the event handlers are running but only when
>>a service
>>check returns OK when it has been in another state. This is not very
>>useful since an event handler should be fixing the occurring problems
>>not trying to fix them after they are manually fixed.  Ive included a
>>log file of one host/service which experiences the problem (qouted
>>below) so that people can see what I mean,
>>
>>Any thoughts would be appreciated,
>>    
>>
>
>IIRC, the event handler is run after each state change, whether it be
>hard or soft. Whether or not the handler does anything at these various
>stages is a function of the event handler itself. My guess is that this
>was not apparent to you before, or you would have posted the event
>handler script and requested help debugging that. Therefore, you should
>probably drop back ten yards and punt. Go back and read the docs again
>(http://nagios.sourceforge.net/docs/1_0/eventhandlers.html), and pay
>special attention to the example 'restart-httpd' script. 
>  
>


Maybe you should read the docs??? I know the event handlers run in any 
event and it should log that it ran (no matter if the script does 
anything). In my situation it is NOT running unless the state goes to 
OK, this is what im trying to find out. My config seems perfectly fine 
and I have been over the docs with a fine-tooth comb to ensure that 
everything is correct (Im not a great fan of emailing a question if its 
documented, becuase I work with users everyday who dont read the docs 
and it urks me)

Below is the script it is currently running, since Nagios should run the 
script in any situtation as long as its able to run it (when is evident 
by the fact it runs it on an OK status) it shouldnt be required.

The very first line (after the #!/bin/sh) sends the command args to the 
/tmp/naggingevents.log file, however the only events logged to this file 
are OK's, when clearly every request to this file should appear in the 
file.  The original script I was running was an excat copy of the http 
restart script as thats all it needs to do to fix the defunct problem,

----------------8<----------
#!/bin/sh
echo "`date` :: Event :: $0 $@" >>/tmp/naggingevents.log
exit 0
----------------8<----------


Oh, and from reading your other posts I notice that you dont scroll down 
or relook for the information, so heres what the nagios log says again 
(sorry for filling everyone elses mailbox with duplicate information)

-- 8<-- nagios.log
[1093669850] SERVICE ALERT: creeper;Defuncts;OK;HARD;1;OK - 5 processes 
running with STATE = Z
[1093670146] SERVICE ALERT: creeper;Defuncts;WARNING;HARD;1;WARNING - 6 
processes running with STATE = Z
[1093673451] SERVICE ALERT: creeper;Defuncts;WARNING;HARD;1;WARNING - 7 
processes running with STATE = Z
[1093677052] SERVICE ALERT: creeper;Defuncts;WARNING;HARD;1;WARNING - 8 
processes running with STATE = Z
[1093680652] SERVICE ALERT: creeper;Defuncts;WARNING;HARD;1;WARNING - 10 
processes running with STATE = Z
[1093684251] SERVICE ALERT: creeper;Defuncts;WARNING;HARD;1;WARNING - 10 
processes running with STATE = Z
[1093685900] SERVICE ALERT: creeper;Defuncts;CRITICAL;HARD;1;CRITICAL - 
11 processes running with STATE = Z
[1093687852] SERVICE ALERT: creeper;Defuncts;CRITICAL;HARD;1;CRITICAL - 
11 processes running with STATE = Z
[1093691451] SERVICE ALERT: creeper;Defuncts;CRITICAL;HARD;1;CRITICAL - 
13 processes running with STATE = Z
[1093695059] SERVICE ALERT: creeper;Defuncts;CRITICAL;HARD;1;CRITICAL - 
15 processes running with STATE = Z
[1093696438] SERVICE ALERT: creeper;Defuncts;OK;HARD;1;OK - 0 processes 
running with STATE = Z
[1093696438] SERVICE EVENT HANDLER: 
creeper;Defuncts;OK;HARD;1;allserver_defunct_fix
[1093696516] SERVICE ALERT: creeper;Defuncts;OK;HARD;1;OK - 0 processes 
running with STATE = Z
[1093696624] SERVICE ALERT: creeper;Defuncts;OK;HARD;1;OK - 0 processes 
running with STATE = Z
[1093696673] SERVICE ALERT: creeper;Defuncts;OK;HARD;1;OK - 0 processes 
running with STATE = Z
[1093697080] SERVICE ALERT: creeper;Defuncts;OK;HARD;1;OK - 1 processes 
running with STATE = Z
-- 8<-- End nagios.log


You may want to note the existance of only one event handler running:
[1093696438] SERVICE EVENT HANDLER: 
creeper;Defuncts;OK;HARD;1;allserver_defunct_fix




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
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