How to enable Naemon debug logging
To enable debug logging in Naemon, edit the Naemon configuration file /opt/monitor/etc/naemon.cfg.
TL;DR Copied
debug_file=/opt/monitor/var/naemon.debug
debug_level=-1
debug_verbosity=1
max_debug_file_size=104857600
Followed by:
# service naemon restart
Debug log file path Copied
The following line sets the location of the debug log file. We recommend not changing this to make sure that it’s easy to find:
debug_file=/opt/monitor/var/naemon.debug
Debug level Copied
debug_level=0
This option determines what type of information Naemon should write to the debug_file.
This value is a logical OR of the values below.
- -1 = Log everything
- 0 = Log nothing (default)
- 1 = Function enter/exit information
- 2 = Config information
- 4 = Process information
- 8 = Scheduled event information
- 16 = Host/service check information
- 32 = Notification information
- 64 = Event broker information
To log everything, set this option to -1.
Debug verbosity Copied
debug_verbosity=1
This option determines how much debugging information Naemon should write to the debug_file.
- 0 = Basic information
- 1 = More detailed information (default)
- 2 = Highly detailed information
Max debug log file size Copied
To avoid running out of space, since debug logging can go a bit wild, consider setting a maximum file size for the debug log file.
This option determines the maximum size (in bytes) of the debug file.
If the file grows larger than this size, it will be renamed with a .old extension. If a file already exists with a .old extension, it will automatically be deleted. This helps ensure your disk space usage doesn’t get out of control when debugging Naemon. The following sets the maximum file size to 100MB:
max_debug_file_size=104857600
Restart Naemon Copied
To have the changes taking effect, restart Naemon:
# service naemon restart
Additional reading Copied
Consider reading the official Naemon documentation, which served as a background for this article:
https://www.naemon.org/documentation/usersguide/configmain.html