By default, Nagios logs events for the host and services in the /var/log/nagios/nagios.log file. Use the /etc/nagios/nagios.cfg file to control logging for Nagios. For information about logging options, see Table 7-3.
Table 7-3 Nagios Logging Options
Logging Parameter |
Description and Logging Options |
Default Setting |
---|---|---|
log_file |
Specifies the path of the log file, including the file name. |
/var/log/nagios/nagios.log |
log_rotation_method |
Specifies the rotation method that Nagios should use to rotate its main log file, or disables rotation of the log.
|
Rotate the nagios.log file at midnight every day. |
log_archive_path |
Specifies the path of the directory where rotated (archived) log files are stored, if log rotation is enabled. |
/var/log/nagios/archives |
use_syslog |
Specifies whether to log Nagios messages to the syslog facility as well as to the Nagios main log file.
|
Messages are sent to syslog as well as to nagios.log. |
log_notifications |
Specifies whether to log notifications.
|
Log notifications. |
log_service_retries |
Specifies whether to log service check retries.
|
Log service retries. |
log_host_retries |
Specifies whether to log host check retries.
|
Log host check retries. |
log_event_handlers |
Specifies whether to log host and service event handlers.
|
Log host and service event handlers. |
log_initial_states |
Specifies whether to log the initial state for every host and service the first time its status is checked. Enable this option only if you are using an external application that reports its long-term state statistics.
|
Do not log the initial state for every host and service. |
log_external_commands |
Specifies whether to log external commands.
NOTE:The check_external_commands option is enabled by default for OES Remote Manager. This enables you to use the CGI command interface. The command_check_interval is set to -1 by default for OES Remote Manager. This causes Nagios to check the external command file as often as possible. |
Log external commands. |
log_passive_checks |
Specifies whether to log passive host and service checks.
|
Log passive checks. |