Guides‎ > ‎Tricks‎ > ‎

Debugging

Debug logs are a great way to track down problems when you've exhausted your normal troubleshooting avenues.

Turn On Debugging

This sets debugging to output the most information.

Command:
sed -i 's/.*debug_level=.*/debug_level=-1/g' /usr/local/nagios/etc/nagios.cfg
service nagios restart

Turn Off Debugging

This turns debugging off.

Command:
sed -i 's/.*debug_level=.*/debug_level=0/g' /usr/local/nagios/etc/nagios.cfg
service nagios restart

Watch The Debug Log

When debugging is enabled you can watch the log live.

Command:
tail -f /usr/local/nagios/var/nagios.debug


You can also filter the output so it only shows items that contain strings you are interested in. The followin example will only output lines that contain the word "flapping":

Command:
tail -f /usr/local/nagios/var/nagios.debug | grep flapping