Event handler question

Mark Ahlstrom mark.ahlstrom at managedmail.com
Thu Sep 8 21:27:02 CEST 2005


I'm trying to put local event handlers in place for a couple of
services. I created a test script so I could understand the interaction
between nagios, the script and the events. The test script does nothing
other than print the passed arguments to a file, in perl, "arg# ::
arg-value". 

The script is supposed to execute when a state change occurs, and you
can see the event handler logging in nagios.log. But the script is not
executed. It's only executed when the service returns. 

Here's my log from one test (filling up the file system)...


[1126205981] EXTERNAL COMMAND:
SCHEDULE_FORCED_SVC_CHECK;smt;DISKS;1126205963
[1126206041] SERVICE ALERT: smt;DISKS;CRITICAL;SOFT;1;Critical: /(95%)
[1126206041] SERVICE EVENT HANDLER:
smt;DISKS;CRITICAL;SOFT;1;handler-service-test
[1126206171] SERVICE ALERT: smt;DISKS;CRITICAL;SOFT;2;Critical: /(95%)
[1126206171] SERVICE EVENT HANDLER:
smt;DISKS;CRITICAL;SOFT;2;handler-service-test
[1126206299] SERVICE ALERT: smt;DISKS;CRITICAL;HARD;3;Critical: /(95%)
[1126206299] SERVICE NOTIFICATION:
mark-mail;smt;DISKS;CRITICAL;notify-by-email;Critical: /(95%)
[1126206300] SERVICE NOTIFICATION:
mark;smt;DISKS;CRITICAL;notify-by-epager;Critical: /(95%)
[1126206300] SERVICE NOTIFICATION:
mark;smt;DISKS;CRITICAL;notify-by-email;Critical: /(95%)
[1126206300] SERVICE EVENT HANDLER:
smt;DISKS;CRITICAL;HARD;3;handler-service-test
[1126206339] EXTERNAL COMMAND:
SCHEDULE_FORCED_SVC_CHECK;smt;DISKS;1126206327
[1126206399] EXTERNAL COMMAND:
ADD_SVC_COMMENT;smt;DISKS;1;nscmd;ACKNOWLEDGEMENT via SleepNscmd
[1126206399] EXTERNAL COMMAND:
ACKNOWLEDGE_SVC_PROBLEM;smt;DISKS;0;ACKNOWLEDGEMENT via SleepNscmd
[1126206404] SERVICE ALERT: smt;DISKS;OK;HARD;3;All disks below
warning/critical thresholds
[1126206404] SERVICE NOTIFICATION:
mark-mail;smt;DISKS;OK;notify-by-email;All disks below warning/critical
thresholds
[1126206404] SERVICE EVENT HANDLER:
smt;DISKS;OK;HARD;3;handler-service-test

Here's the script output from this one test.

0 :: OK
1 :: HARD
2 :: 3
3 :: smt
4 :: DISKS
5 :: 1126206404
6 :: All
7 :: disks
8 :: below
9 :: warning/critical
10 :: thresholds

I included the $TIMET$ and $OUTPUT$ macros, and you can clearly see that
the time correlates only to the hard recovery. 

Am I missing a configuration switch somewhere? I have event_handlers
enabled in the nagios.cfg and in the services.cfg. 

Mark




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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