9.2. Default Nagios Configuration

The configuration file for Nagios is available at /etc/nagios/nagios.cfg. You can modify the parameters by changing the default values in the configuration file.
Table 9.1, “Nagios Configuration Parameters” lists the default values for the configuration parameters with OpenStack PackStack deployment.

Note

The default values that are common to Nagios configuration without PackStack are not listed below.
For more details on Nagios configuration parameters, refer to the Red Hat Enterprise Linux OpenStack Platform Installation and Configuration Guide.

Table 9.1. Nagios Configuration Parameters

Configuration Parameter Default Value/Location Description
Nagios Log File /var/log/nagios/nagios.log Log file that contains all the services and host events.
Object Configuration Files /etc/nagios/objects/*.cfg Configuration files in which you can define hosts, host groups, contacts, contact groups, services, etc.
Object Cache File /var/log/nagios/objects.cache Location of cached object definitions when Nagios starts/restarts.
Pre-Cached File /var/log/nagios/objects.precache Location of the precached object file.
Temporary File /var/log/nagios/nagios.tmp Temporary file used as scratch space when Nagios updates the status log, cleans the comment file, etc. This file is created, used, and deleted throughout the time that Nagios is running.
Status File /var/log/nagios/status.dat File which stores the location of the current status of all monitored services and hosts. Its contents are read and processed by the CGIs. The contents of the status file are deleted every time Nagios restarts.
Resource File /etc/nagios/private/resource.cfg Optional resource file that contains $USERx$ macro definitions. Multiple resource files can be specified by using multiple resource_file definitions.
Status File Update Interval status_update_interval=10 Determines the frequency (in seconds) that Nagios will periodically dump program, host, and service status data.
External Command File /var/spool/nagios/cmd/nagios.cmd File that Nagios checks for external command requests.
External Command Buffer Slots external_command_buffer_slots=4096 Parameter that can be tweaked so that the Nagios daemon can allocate the number of items or "slots" to the buffer that holds incoming external commands before they are processed. As external commands are processed by the daemon, they are removed from the buffer.
Lock File /var/run/nagios.pid Lock file that Nagios uses to store its PID number in when it is running in daemon mode.
Log Archive Path /var/log/nagios/archives Directory where archived log files are saved.
Initial Logging States Option log_initial_states=0 If you want Nagios to log all initial host and service states to the main log file (the first time the service or host is checked) you can enable this option by setting this value to 1. If you are not using an external application that does long term state statistics reporting, you do not need to enable this option. In this case, set the value to 0.
Maximum Concurrent Service Checks max_concurrent_checks=0 Allows you to specify the maximum number of service checks that can be run in parallel at any given time. Specifying a value of 1 for this variable essentially prevents any service checks from being parallelized. A value of 0 will not restrict the number of concurrent checks that are being executed.
Host and Service Check Reaper Frequency check_result_reaper_frequency=10 Frequency (in seconds) that Nagios will process the results of host and service checks.
Check Result Path /var/log/nagios/spool/checkresults Directory where Nagios stores the results of host and service checks that have not yet been processed.

Note

Make sure that only one instance of Nagios has access to this directory.
Time Change Adjustment Thresholds time_change_threshold=900 Determines when Nagios will react to detected changes in system time (either forward or backwards).
Auto-Rescheduling Option auto_reschedule_checks=0 Determines whether or not Nagios will attempt to automatically reschedule active host and service checks to "smooth" them out over time. This can help balance the load on the monitoring server.
Sleep Time sleep_time=0.25 Time (in seconds) to sleep between checking for system events and service checks that need to be run.
Timeout Values service_check_timeout=60, host_check_timeout=30, event_handler_timeout=30, notification_timeout=30, ocsp_timeout=5, perfdata_timeout=5 Option to control how much time Nagios will allow various types of commands to execute before killing them off. Options are available for controlling maximum time allotted for service checks, host checks, event handlers, notifications, the ocsp command, and performance data commands. All values are in seconds.
State Retention File /var/log/nagios/retention.dat File that Nagios uses to store host and service state information before it shuts down. The state information in this file is read prior to monitoring the network when Nagios is restarted. This file is used only if the retain_state_information variable is set to 1.
Process Performance Data Option process_performance_data=0 Determines whether or not Nagios will process performance data returned from service and host checks. If this option is enabled, host performance data will be processed using the host_perfdata_command and service performance data will be processed using the service_perfdata_command. Values: 1 = process performance data, 0 = do not process performance data.
Host and Service Performance Data Files /tmp/host-perfdata, /tmp/service-perfdata Files used to store host and service performance data. Performance data is only written to these files if the enable_performance_data option is set to 1.
Host and Service Performance Data Process Empty Results host_perfdata_process_empty_results=1, service_perfdata_process_empty_results=1 Determine whether the core will process empty performance data results or not. This is needed for distributed monitoring, and intentionally turned on by default. Values: 1 = enable, 0 = disable.
Obsess Over Service Checks Option obsess_over_services=0 Determines whether Nagios runs the predefined ocsp_command command after every service check (that is, whether Nagios obsesses over these services). Unless you are planning on implementing distributed monitoring, do not enable this option. Values: 1 = obsess over services, 0 = do not obsess (default).
Obsess Over Host Checks Option obsess_over_hosts=0 Determines whether Nagios runs the predefined ocsp_command command after every host check (that is, whether Nagios obsesses over these hosts). Unless you are planning on implementing distributed monitoring, do not enable this option. Values: 1 = obsess over hosts, 0 = do not obsess (default).
Translate Passive Host Checks Option translate_passive_host_checks=0 Determines whether or not Nagios will translate DOWN/UNREACHABLE passive host check results into their proper state for this instance of Nagios. Values: 1 = perform translation, 0 = do not translate (default).
Passive Host Checks Are SOFT Option passive_host_checks_are_soft=0 Determines whether or not Nagios will treat passive host checks as being HARD or SOFT. By default, a passive host check result will put a host into a HARD state type. This can be changed by enabling this option. Values: 0 = passive checks are HARD, 1 = passive checks are SOFT.
Service Freshness Check Option check_service_freshness=1 Determines whether or not Nagios will periodically check the "freshness" of service results. Enabling this option is useful for ensuring passive checks are received in a timely manner. Values: 1 = enabled freshness checking, 0 = disable freshness checking.
Service Check Timeout State service_check_timeout_state=c Determines the state Nagios will report when a service check times out, that is when a service does not respond within service_check_timeout seconds. This can be useful if a machine is running at too high a load and you do not want to consider a failed service check to be critical (the default). Valid settings are: c - Critical (default), u - Unknown, w - Warning, o - OK
Flap Detection Option enable_flap_detection=1 Determines whether or not Nagios will try and detect hosts and services that are "flapping". Flapping occurs when a host or service changes between states too frequently. When Nagios detects that a host or service is flapping, it will temporarily suppress notifications for that host/service until it stops flapping. Values: 1 = enable flap detection, 0 = disable flap detection (default)
Flap Detection Thresholds for Hosts and Services low_service_flap_threshold=5.0, high_service_flap_threshold=20.0, low_host_flap_threshold=5.0, high_host_flap_threshold=20.0 This option has no effect if flap detection is disabled.
P1.pl File Location /usr/sbin/p1.pl Determines the location of the p1.pl perl script (used by the embedded Perl interpreter). If you didn't compile Nagios with embedded Perl support, this option has no effect.
Administrator Email/Pager Address admin_email=nagios@localhost, admin_pager=pagenagios@localhost The email and pager address of a global administrator. Nagios never uses these values itself, but you can access them by using the $ADMINEMAIL$ and $ADMINPAGER$ macros in your notification commands.
Daemon Core Dump Option daemon_dumps_core=0 Determines whether or not Nagios is allowed to create a core dump when it runs as a daemon. Values: 1 - Allow core dumps, 0 - Do not allow core dumps (default).

Note

Generally, setting this option is not recommended, but it may be useful for debugging purposes.
Enabling this option does not guarantee that a core file will be created.
Debug Level debug_level=0 Determines how much (if any) debugging information will be written to the debug file. OR values together to log multiple types of information. Values: -1 = Everything, 0 = Nothing, 1 = Functions, 2 = Configuration, 4 = Process information, 8 = Scheduled events, 16 = Host/service checks, 32 = Notifications, 64 = Event broker, 128 = External commands, 256 = Commands, 512 = Scheduled downtime, 1024 = Comments, 2048 = Macros
Debug file /var/log/nagios/nagios.debug Location of the file where Nagios writes debugging information.