event handler debug

Matthew Jurgens nagiosusers at edcint.co.nz
Tue Nov 27 22:59:27 CET 2012


For shell based event handlers I normally add these lines to the top of 
the script:

set -x
exec >> /tmp/event.log 2>&1
echo "================= Started `date` ================"
set

This way, everything the event handler does is written to the file 
/tmp/event.log

Also, this page: http://edcint.co.nz/checkwmiplus/?q=genericeventhandler
is about a generic event handler which could replace your event handler 
just by passing it some parameters. The other advantage of the generic 
event handler is that is has good logging and debug features.

This page: http://edcint.co.nz/checkwmiplus/?q=faq_worksoncommandline
is about plugins that don't work in Nagios but work on the command line. 
Most of the pointers here also apply to event handlers.

On 28/11/2012 6:16 AM, Assaf Flatto wrote:
> On 27/11/12 17:32, fatcharly at gmx.de wrote:
>> Hi,
>>
>> I`m using a nagios 3.0.3 on a CentOS 5.8 and I´m a little stuck with a eventhandeler problem- I can`t see it running and I can´t find a problem in the logfiles. Here a short overview:
>>
>


-- 
Smartmon System Monitoring <http://www.smartmon.com.au>
www.smartmon.com.au <http://www.smartmon.com.au>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20121128/52debd55/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
DESIGN Expert tips on starting your parallel project right.
http://goparallel.sourceforge.net
-------------- next part --------------
_______________________________________________
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