Event Handlers

Gürkan Aslan gurkan.aslan at comturk.com
Wed Oct 15 17:18:24 CEST 2008


Hi Francis,

Thanks for your answer but i solved the problem.

My Mistakes:
	* I must use full path in my bash script.
	* Event Handler is triggering the event only for the first state
change.

Best regards

Çrş, 2008-10-15 tarihinde 10:51 -0400 saatinde, Francis Dube yazdı:
> Gürkan Aslan a écrit :
> > Hi,
> >
> > I'm trying to define an event handler for nagios. Actually it will work
> > same as event handler example
> > (http://nagios.sourceforge.net/docs/3_0/eventhandlers.html#example) but
> > it doesn't work... i'm trying to create a file in /tmp folder to test,
> > but nothing in return. event_handler_enabled = 1 in service definition
> > and nagios.cfg.
> >
> > with nagios user, i can create a file under /tmp folder
> > (touch /tmp/foo). Actually i'm trying to restart a service. I defined a
> > sudo command for nagios like this (in /etc/sudoers file)
> >
> > nagios  LOCAL=NOPASSWD:/etc/init.d/myservice restart
> >
> > sudo /etc/init.d/myservice restart command is properly running as nagios
> > user (I'm switching user by: su - nagios).
> >
> > But i cannot run both of them via an event handler. As i feel that
> > nagios couldn't trigger the event file...
> >
> > Any suggestion?
> >
> > Best regards
> >   
> Is your event handler script correctly assigned to your service ? 
> (event_handler   your-event-handler)
> 
> Can you give me your command definition for you event handler, something 
> like :
> 
> define command{
> 	command_name	your-event-handler
> 	command_line	/usr/local/nagios/libexec/eventhandlers/your-event-handler  $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $ANY_OTHER_VARIABLE_YOU_MAY_NEED$
> 	}
> 
> 
> Francis Dube
> R&D - Optik Securite
> www.optiksecurite.com
-- 
Gürkan Aslan
Senior Developer
Komturk Iletisim Ltd. Sti
Phone: +90 212 275 88 99 ext 125


-------------------------------------------------------------------------
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=/
_______________________________________________
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