When do service event handlers get called?

Anurag Gupta agupta at yahoo-inc.com
Tue Apr 1 20:23:24 CEST 2003


Hi,

I apologize for misphrasing the question.

I get email/pager notifications/escalations etc. everytime a service state
changes. I have a service handler in place. It gets called at every service
state change. I use this handler to log downtimes for services.

Now, the problem is:
Suppose, a host goes down (before a service on it is detected to be down). I
get notification for this host gone down. I DONT get notifications for
individual services running on this host. Also, my service handler doesnt
get called in this case. Now, I can define a host-event-handler that will do
the following:

1) Log each service gone DOWN as soon as the host goes down.
2) Log each service back UP as soon as the host comes back up. (I dont know
when the actual service got up.)

My question is:
I can avoid doing 2) in host-event-handler ONLY IF the service-event-handler
is going to get called after the host comes back up. Is the
service-event-handler called in this case?

I am doing it through global (host and service) handlers.

thanks
-anurag

-----Original Message-----
From: Stanley Hopcroft [mailto:Stanley.Hopcroft at IPAustralia.Gov.AU]
Sent: Monday, March 31, 2003 10:19 PM
To: Anurag Gupta
Cc: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] When do service event handlers get called?


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