Event Handler problems

Marc Powell marc at ena.com
Thu Mar 1 16:23:53 CET 2007



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Sandeep Narasimha Murthy
> Sent: Thursday, March 01, 2007 8:17 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Event Handler problems
> 
> Hi,
> 
> I have been trying to set up the Nagios Eventhandler option for quite
> sometime in vain. I perused the link
> http://nagios.sourceforge.net/docs/1_0/eventhandlers.html and tried
out
> a number of time but the script to be execute by the event handler
never
> gets executed.. :(
> 
> In the nagios log, I see the Event Handler being invoked fine and
> nothing else happens.
> 
> Any ideas/ suggestions ?

Is your event handler executable by the nagios user? I'd add debug
output to the event handler that gets written to a file to make sure
that it's actually running and getting the input you expect. For
example, in all my event handlers written in sh, I have the following as
the first thing done --

LOGFILE=/usr/local/nagios/var/eventhandler.log; export LOGFILE

echo -n `date` . " " >> $LOGFILE 2>&1
echo "$0 IFP service check ($1) ($2) ($3) ($4)... " >> $LOGFILE 2>&1

And lines like the following at appropriate places --

echo -n `date` . " " >> $LOGFILE
2>/usr/local/nagios/var/eventhandler.log 2>&1
echo -n "$0 Restarting IFP service (2nd soft critical state) on $4... "
>> $LOGFILE 2>&1
/usr/bin/ssh $4 'sudo /etc/init.d/n2h2-ifpserver restart' >>$LOGFILE
2>&1

This allows for intimate tracing of the execution of the event handler
to catch any problems.

--
Marc

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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