event handler not working

Billy Liang billylg at hotmail.com
Tue Dec 13 00:20:52 CET 2005


Hello Eli,

Thanks for responding. I found out what's my problem.  I wasn't able to get 
any output when I remove dumping content to STDERR, but I was able to pipe 
the output to a file. At there I saw what's the problem.  Because the plugin 
output contains white space, i need to wrap it with double quotes to make it 
pass to the program as a single argument. Now it's working fine. Thanks for 
the suggestion.

billy



>From: Eli Stair <estair at ilm.com>
>To: Billy Liang <billylg at hotmail.com>
>CC: nagios-devel at lists.sourceforge.net
>Subject: Re: [Nagios-devel] event handler not working
>Date: Mon, 12 Dec 2005 10:10:14 -0800
>
>
>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