When do service event handlers get called?

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Tue Apr 1 08:19:02 CEST 2003


Dear Sir,

Yes, the service event handler will be called when the service comes 
back up.

I think this is documented in the glorious Nagios docs.

I too log outage intervals in an mySQL DB; the intervals can only be be 
computed because the event handler is called at the end of the outage.

If you doubt this have a look at the logging options in nagios.cfg and
define a service handler and a dummy service that is monitored with a
plugin like,

#!/bin/sh

test_result='OK'
# test_result='FAIL'

case "$test_result" in 

FAIL)
        echo 'Failed. This service check always fails. Debug check/event 
handlers/notification etc.'
        exit 2
        ;;
OK)
        echo 'Ok. This service check always succeeds. Debug check/event 
handlers/notification etc.'
        exit 0
        ;;
esac

# Exercise event handler
# Go shell, go.

Yours sincerely.

-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.


-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
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