event handler not working
Kevin Manuel
kmanuel at unb.ca
Fri Jun 6 13:49:52 CEST 2008
I should add that I am trying to invoke the event handler through passive
service checks supplied by an external command (the external commands and
passive service checks work fine, but I'm wondering if something needs to be
configured differently for Nagios to call the event handler)
-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Kevin
Manuel
Sent: June-06-08 8:04 AM
To: 'nagios Mailinglist'
Subject: Re: [Nagios-users] event handler not working
Hi,
Nagios.cfg contains the following but there is no log of the event handler
being called:
log_event_handlers=1
enable_event_handlers=1
Any suggestions? Thanks in advance,
Kevin
-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Marc Powell
Sent: June-05-08 4:28 PM
To: nagios Mailinglist
Subject: Re: [Nagios-users] event handler not working
On Jun 5, 2008, at 1:59 PM, Kevin Manuel wrote:
> 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
Nagios should log if it does. You also need to enable event handlers
in nagios.cfg --
$ grep enable_event_handlers etc/nagios.cfg
enable_event_handlers=1
--
Marc
-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Kevin
Manuel
Sent: June-05-08 4:00 PM
To: 'nagios Mailinglist'
Subject: [Nagios-users] event handler not working
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`;
misccommands.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
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
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