event handler not working
Kevin Manuel
kmanuel at unb.ca
Thu Jun 5 20:59:44 CEST 2008
Hi,
I'm trying to get an event handler to work with no success so I'm hoping
somebody might have some suggestions. It appears as though Nagios is not
calling the event handler at all when a service check is performed. I don't
think it's a permissions thing because the event handler works properly when
run by the nagios user at the command line:
i.e. [root at flames bin]# su - nagios -c
"/usr/local/nagios/libexec/eventhandlers/renotify-on-ok"
I have removed all the arguments that are passed to the event handler to
simplify troubleshooting and at this point the event handler should simply
send an email message when the service check is performed. Code shown below.
Thanks in advance.
renotify-on-ok (only 3 lines):
==============================
#!/usr/bin/perl
$contactEmail = "kmanuel\@unb.ca";
`/bin/echo -e ' event handler works! ' | /bin/mail -s '** event handler
works **' $contactEmail`;
checkcommands.cfg:
=====================
define command{
command_name renotify-on-ok
command_line $USER1$/eventhandlers/renotify-on-ok
}
In templates.cfg the service is defined as follows:
===================================================
define service{
use generic-service ; Name of
service template to use
name snmp-trap-alerting-service
service_description SNMP Trap Alert
is_volatile 1
check_period 24x7
active_checks_enabled 0
normal_check_interval 14400
retry_check_interval 14400
max_check_attempts 1
notification_interval 0
notification_period 24x7
notification_options w,u,c,r
check_command check_none
stalking_options o,w,u,c
event_handler renotify-on-ok
event_handler_enabled 1
register 0
}
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
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