Page 1 of 1
event handler question
Posted: Thu Jul 31, 2014 12:11 pm
by smcracraft
Hi,
What is the general troubleshooting process for event handler debugging in Nagios?
Stuart
Re: event handler question
Posted: Thu Jul 31, 2014 12:21 pm
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.