event handler question

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
smcracraft
Posts: 35
Joined: Sat Sep 25, 2010 12:53 pm

event handler question

Post by smcracraft »

Hi,

What is the general troubleshooting process for event handler debugging in Nagios?

Stuart
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: event handler question

Post by tmcdonald »

The first step is always making sure the actual script works. Make sure you aren't testing it just as the root user - it will be run as the nagios user so make sure it works in that context.

Then typically I have it write to a file in a location it would have permission to do so, just to make sure it is firing properly. If this fails double-check the permissions and try writing the file as the nagios user.

After that it's just a matter of adding functionality and unit-testing as you go. Log files are useful for seeing what fails and when in your script, and debugging output can show you each step as it is run.
Former Nagios employee
Locked