343 lines
20 KiB
Plaintext
343 lines
20 KiB
Plaintext
<Comment>##############################################################################</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment># NAGIOS.CFG - Sample Main Config File for Nagios @VERSION@</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment># Read the documentation for more information on this configuration</Comment><br/>
|
|
<Comment># file. I've provided some comments here, but things may not be so</Comment><br/>
|
|
<Comment># clear without further explanation.</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment>##############################################################################</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># LOG FILE</Comment><br/>
|
|
<Comment># This is the main log file where service and host events are logged</Comment><br/>
|
|
<Comment># for historical purposes. This should be the first option specified</Comment><br/>
|
|
<Comment># in the config file!!!</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/nagios.log</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># OBJECT CONFIGURATION FILE(S)</Comment><br/>
|
|
<Comment># These are the object configuration files in which you define hosts,</Comment><br/>
|
|
<Comment># host groups, contacts, contact groups, services, etc.</Comment><br/>
|
|
<Comment># You can split your object definitions across several config files</Comment><br/>
|
|
<Comment># if you wish (as shown below), or keep them all in a single config file.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># You can specify individual object config files as shown below:</Comment><br/>
|
|
<Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/commands.cfg</Value><br/>
|
|
<Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/contacts.cfg</Value><br/>
|
|
<Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/timeperiods.cfg</Value><br/>
|
|
<Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/templates.cfg</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># Definitions for monitoring the local (Linux) host</Comment><br/>
|
|
<Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/localhost.cfg</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># Definitions for monitoring a Windows machine</Comment><br/>
|
|
<Comment>#cfg_file=@sysconfdir@/objects/windows.cfg</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># Definitions for monitoring a router/switch</Comment><br/>
|
|
<Comment>#cfg_file=@sysconfdir@/objects/switch.cfg</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># Definitions for monitoring a network printer</Comment><br/>
|
|
<Comment>#cfg_file=@sysconfdir@/objects/printer.cfg</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># You can also tell Nagios to process all config files (with a .cfg</Comment><br/>
|
|
<Comment># extension) in a particular directory by using the cfg_dir</Comment><br/>
|
|
<Comment># directive as shown below:</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment>#cfg_dir=@sysconfdir@/servers</Comment><br/>
|
|
<Comment>#cfg_dir=@sysconfdir@/printers</Comment><br/>
|
|
<Comment>#cfg_dir=@sysconfdir@/switches</Comment><br/>
|
|
<Comment>#cfg_dir=@sysconfdir@/routers</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># OBJECT CACHE FILE</Comment><br/>
|
|
<Comment># This option determines where object definitions are cached when</Comment><br/>
|
|
<Comment># Nagios starts/restarts. The CGIs read object definitions from</Comment><br/>
|
|
<Comment># this cache file (rather than looking at the object config files</Comment><br/>
|
|
<Comment># directly) in order to prevent inconsistencies that can occur</Comment><br/>
|
|
<Comment># when the config files are modified after Nagios starts.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>object_cache_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/objects.cache</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># PRE-CACHED OBJECT FILE</Comment><br/>
|
|
<Comment># This options determines the location of the precached object file.</Comment><br/>
|
|
<Comment># If you run Nagios with the -p command line option, it will preprocess</Comment><br/>
|
|
<Comment># your object configuration file(s) and write the cached config to this</Comment><br/>
|
|
<Comment># file. You can then start Nagios with the -u option to have it read</Comment><br/>
|
|
<Comment># object definitions from this precached file, rather than the standard</Comment><br/>
|
|
<Comment># object configuration files (see the cfg_file and cfg_dir options above).</Comment><br/>
|
|
<Comment># Using a precached object file can speed up the time needed to (re)start</Comment><br/>
|
|
<Comment># the Nagios process if you've got a large and/or complex configuration.</Comment><br/>
|
|
<Comment># Read the documentation section on optimizing Nagios to find our more</Comment><br/>
|
|
<Comment># about how this feature works.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>precached_object_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/objects.precache</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># RESOURCE FILE</Comment><br/>
|
|
<Comment># This is an optional resource file that contains $USERx$ macro</Comment><br/>
|
|
<Comment># definitions. Multiple resource files can be specified by using</Comment><br/>
|
|
<Comment># multiple resource_file definitions. The CGIs will not attempt to</Comment><br/>
|
|
<Comment># read the contents of resource files, so information that is</Comment><br/>
|
|
<Comment># considered to be sensitive (usernames, passwords, etc) can be</Comment><br/>
|
|
<Comment># defined as macros in this file and restrictive permissions (600)</Comment><br/>
|
|
<Comment># can be placed on this file.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>resource_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/resource.cfg</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># STATUS FILE</Comment><br/>
|
|
<Comment># This is where the current status of all monitored services and</Comment><br/>
|
|
<Comment># hosts is stored. Its contents are read and processed by the CGIs.</Comment><br/>
|
|
<Comment># The contents of the status file are deleted every time Nagios</Comment><br/>
|
|
<Comment># restarts.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>status_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/status.dat</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># STATUS FILE UPDATE INTERVAL</Comment><br/>
|
|
<Comment># This option determines the frequency (in seconds) that</Comment><br/>
|
|
<Comment># Nagios will periodically dump program, host, and</Comment><br/>
|
|
<Comment># service status data.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>status_update_interval</Variable><Symbol>=</Symbol><Int>10</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># NAGIOS USER</Comment><br/>
|
|
<Comment># This determines the effective user that Nagios should run as.</Comment><br/>
|
|
<Comment># You can either supply a username or a UID.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>nagios_user</Variable><Symbol>=</Symbol><Value>@nagios_user@</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># NAGIOS GROUP</Comment><br/>
|
|
<Comment># This determines the effective group that Nagios should run as.</Comment><br/>
|
|
<Comment># You can either supply a group name or a GID.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>nagios_group</Variable><Symbol>=</Symbol><Value>@nagios_grp@</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># EXTERNAL COMMAND OPTION</Comment><br/>
|
|
<Comment># This option allows you to specify whether or not Nagios should check</Comment><br/>
|
|
<Comment># for external commands (in the command file defined below).</Comment><br/>
|
|
<Comment># By default Nagios will check for external commands.</Comment><br/>
|
|
<Comment># If you want to be able to use the CGI command interface</Comment><br/>
|
|
<Comment># you will have to enable this.</Comment><br/>
|
|
<Comment># Values: 0 = disable commands, 1 = enable commands</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>check_external_commands</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># EXTERNAL COMMAND FILE</Comment><br/>
|
|
<Comment># This is the file that Nagios checks for external command requests.</Comment><br/>
|
|
<Comment># It is also where the command CGI will write commands that are submitted</Comment><br/>
|
|
<Comment># by users, so it must be writeable by the user that the web server</Comment><br/>
|
|
<Comment># is running as (usually 'nobody'). Permissions should be set at the</Comment><br/>
|
|
<Comment># directory level instead of on the file, as the file is deleted every</Comment><br/>
|
|
<Comment># time its contents are processed.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>command_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/rw/nagios.cmd</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># QUERY HANDLER INTERFACE</Comment><br/>
|
|
<Comment># This is the socket that is created for the Query Handler interface</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment>#query_socket=@localstatedir@/rw/nagios.qh</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># LOCK FILE</Comment><br/>
|
|
<Comment># This is the lockfile that Nagios will use to store its PID number</Comment><br/>
|
|
<Comment># in when it is running in daemon mode.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>lock_file</Variable><Symbol>=</Symbol><Value>@subsyslockfile@</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># TEMP FILE</Comment><br/>
|
|
<Comment># This is a temporary file that is used as scratch space when Nagios</Comment><br/>
|
|
<Comment># updates the status log, cleans the comment file, etc. This file</Comment><br/>
|
|
<Comment># is created, used, and deleted throughout the time that Nagios is</Comment><br/>
|
|
<Comment># running.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>temp_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/nagios.tmp</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># TEMP PATH</Comment><br/>
|
|
<Comment># This is path where Nagios can create temp files for service and</Comment><br/>
|
|
<Comment># host check results, etc.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>temp_path</Variable><Symbol>=</Symbol><Value>@TMPDIR@</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># EVENT BROKER OPTIONS</Comment><br/>
|
|
<Comment># Controls what (if any) data gets sent to the event broker.</Comment><br/>
|
|
<Comment># Values: 0 = Broker nothing</Comment><br/>
|
|
<Comment># -1 = Broker everything</Comment><br/>
|
|
<Comment># <other> = See documentation</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>event_broker_options</Variable><Symbol>=</Symbol><Value>-</Value><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># EVENT BROKER MODULE(S)</Comment><br/>
|
|
<Comment># This directive is used to specify an event broker module that should</Comment><br/>
|
|
<Comment># by loaded by Nagios at startup. Use multiple directives if you want</Comment><br/>
|
|
<Comment># to load more than one module. Arguments that should be passed to</Comment><br/>
|
|
<Comment># the module at startup are separated from the module path by a space.</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment>#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</Comment><br/>
|
|
<Comment># </Comment><Alert Level 2>WARNING</Alert Level 2><Comment> !!! </Comment><Alert Level 2>WARNING</Alert Level 2><Comment> !!! </Comment><Alert Level 2>WARNING</Alert Level 2><Comment> !!! </Comment><Alert Level 2>WARNING</Alert Level 2><Comment> !!! </Comment><Alert Level 2>WARNING</Alert Level 2><Comment> !!! </Comment><Alert Level 2>WARNING</Alert Level 2><br/>
|
|
<Comment>#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment># Do NOT overwrite modules while they are being used by Nagios or Nagios</Comment><br/>
|
|
<Comment># will crash in a fiery display of SEGFAULT glory. This is a bug/limitation</Comment><br/>
|
|
<Comment># either in dlopen(), the kernel, and/or the filesystem. And maybe Nagios...</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment># The correct/safe way of updating a module is by using one of these methods:</Comment><br/>
|
|
<Comment># 1. Shutdown Nagios, replace the module file, restart Nagios</Comment><br/>
|
|
<Comment># 2. Delete the original module file, move the new module file into place,</Comment><br/>
|
|
<Comment># restart Nagios</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment># Example:</Comment><br/>
|
|
<Comment>#</Comment><br/>
|
|
<Comment># broker_module=<modulepath> [moduleargs]</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment>#broker_module=/somewhere/module1.o</Comment><br/>
|
|
<Comment>#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># LOG ROTATION METHOD</Comment><br/>
|
|
<Comment># This is the log rotation method that Nagios should use to rotate</Comment><br/>
|
|
<Comment># the main log file. Values are as follows..</Comment><br/>
|
|
<Comment># n = None - don't rotate the log</Comment><br/>
|
|
<Comment># h = Hourly rotation (top of the hour)</Comment><br/>
|
|
<Comment># d = Daily rotation (midnight every day)</Comment><br/>
|
|
<Comment># w = Weekly rotation (midnight on Saturday evening)</Comment><br/>
|
|
<Comment># m = Monthly rotation (midnight last day of month)</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_rotation_method</Variable><Symbol>=</Symbol><Value>d</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># LOG ARCHIVE PATH</Comment><br/>
|
|
<Comment># This is the directory where archived (rotated) log files should be</Comment><br/>
|
|
<Comment># placed (assuming you've chosen to do log rotation).</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_archive_path</Variable><Symbol>=</Symbol><Value>@localstatedir@/archives</Value><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># LOGGING OPTIONS</Comment><br/>
|
|
<Comment># If you want messages logged to the syslog facility, as well as the</Comment><br/>
|
|
<Comment># Nagios log file set this option to 1. If not, set it to 0.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>use_syslog</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># NOTIFICATION LOGGING OPTION</Comment><br/>
|
|
<Comment># If you don't want notifications to be logged, set this value to 0.</Comment><br/>
|
|
<Comment># If notifications should be logged, set the value to 1.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_notifications</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># SERVICE RETRY LOGGING OPTION</Comment><br/>
|
|
<Comment># If you don't want service check retries to be logged, set this value</Comment><br/>
|
|
<Comment># to 0. If retries should be logged, set the value to 1.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_service_retries</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># HOST RETRY LOGGING OPTION</Comment><br/>
|
|
<Comment># If you don't want host check retries to be logged, set this value to</Comment><br/>
|
|
<Comment># 0. If retries should be logged, set the value to 1.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_host_retries</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># EVENT HANDLER LOGGING OPTION</Comment><br/>
|
|
<Comment># If you don't want host and service event handlers to be logged, set</Comment><br/>
|
|
<Comment># this value to 0. If event handlers should be logged, set the value</Comment><br/>
|
|
<Comment># to 1.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_event_handlers</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># INITIAL STATES LOGGING OPTION</Comment><br/>
|
|
<Comment># If you want Nagios to log all initial host and service states to</Comment><br/>
|
|
<Comment># the main log file (the first time the service or host is checked)</Comment><br/>
|
|
<Comment># you can enable this option by setting this value to 1. If you</Comment><br/>
|
|
<Comment># are not using an external application that does long term state</Comment><br/>
|
|
<Comment># statistics reporting, you do not need to enable this option. In</Comment><br/>
|
|
<Comment># this case, set the value to 0.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_initial_states</Variable><Symbol>=</Symbol><Int>0</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># CURRENT STATES LOGGING OPTION</Comment><br/>
|
|
<Comment># If you don't want Nagios to log all current host and service states</Comment><br/>
|
|
<Comment># after log has been rotated to the main log file, you can disable this</Comment><br/>
|
|
<Comment># option by setting this value to 0. Default value is 1.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_current_states</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># EXTERNAL COMMANDS LOGGING OPTION</Comment><br/>
|
|
<Comment># If you don't want Nagios to log external commands, set this value</Comment><br/>
|
|
<Comment># to 0. If external commands should be logged, set this value to 1.</Comment><br/>
|
|
<Comment># Note: This option does not include logging of passive service</Comment><br/>
|
|
<Comment># checks - see the option below for controlling whether or not</Comment><br/>
|
|
<Comment># passive checks are logged.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_external_commands</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># PASSIVE CHECKS LOGGING OPTION</Comment><br/>
|
|
<Comment># If you don't want Nagios to log passive host and service checks, set</Comment><br/>
|
|
<Comment># this value to 0. If passive checks should be logged, set</Comment><br/>
|
|
<Comment># this value to 1.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable>log_passive_checks</Variable><Symbol>=</Symbol><Int>1</Int><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment># GLOBAL HOST AND SERVICE EVENT HANDLERS</Comment><br/>
|
|
<Comment># These options allow you to specify a host and service event handler</Comment><br/>
|
|
<Comment># command that is to be run for every host or service state change.</Comment><br/>
|
|
<Comment># The global event handler is executed immediately prior to the event</Comment><br/>
|
|
<Comment># handler that you have optionally specified in each host or</Comment><br/>
|
|
<Comment># service definition. The command argument is the short name of a</Comment><br/>
|
|
<Comment># command definition that you define in your host configuration file.</Comment><br/>
|
|
<Comment># Read the HTML docs for more information.</Comment><br/>
|
|
<Variable></Variable><br/>
|
|
<Comment>#global_host_event_handler=somecommand</Comment><br/>
|
|
<Comment>#global_service_event_handler=somecommand</Comment><br/>
|