event handler not working

Eli Stair estair at ilm.com
Mon Dec 12 19:10:14 CET 2005


When you're not dumping STDERR to /dev/null does your script/binary 
output anything useful?  Try enabling some verbosity inside of it to see 
where/why it's failing.  It would be most useful to anyone else as well.

/eli

Billy Liang wrote:
> Hello,
> 
> I am a newbie to the Nagios community. I developed an event handler for 
> Nagios, but somehow it doesn't seem to be working.  Here's the command 
> definition for the event handler:
> 
> define command {
>        command_name    fix_taosvcs
>        command_line    /opt/nagios/libexec/wpj/tao_event_handler 
> $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $SERVICEOUTPUT$ 
> 2>/dev/null
>        }
> 
> If I ran the program separately such as the following, it works fine:
> /opt/nagios/libexec/wpj/tao_event_handle CRITICAL HARD 4 "CRITICAL Level 
> 0 - 0 warning[] - 1 critical[PbxCmdMgr/0]"
> I tried running the program as nagios user, and it works. So I don't 
> think it's permission problem. When I looked at the nagios log, it seems 
> to have called the event handler.  Following is the log:
> 
> SERVICE ALERT: linux05;CHKTAO;CRITICAL;HARD;4;CRITICAL: Level 2 - 0 
> warning[] 1 critical[PbxCmdMgr/0]
> [1134130290] SERVICE EVENT HANDLER: 
> linux05;CHKTAO;CRITICAL;HARD;4;fix_taosvcs
> 
> However when the program run under Nagios as event handler, it doesn't 
> do anything. It's very perplexing.  I am running Nagios 2.0b3, I am 
> wondering if this version is too old for some of the macro that I used.  
> In order for the event handler to do anything meaningful, it needs to 
> have access to the content of $SERVICEOUTPUT$.
> 
> Any advise on how to debug this problem will be greatly appreciated. 
> Thank you.
> 
> Billy
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log 
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Nagios-devel mailing list
> Nagios-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-devel
> 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click




More information about the Developers mailing list