Warning, /frameworks/syntax-highlighting/autotests/reference/nagios.cfg.ref is written in an unsupported language. File is not indexed.

0001 <Comment>##############################################################################</Comment><br/>
0002 <Comment>#</Comment><br/>
0003 <Comment># NAGIOS.CFG - Sample Main Config File for Nagios @VERSION@</Comment><br/>
0004 <Comment>#</Comment><br/>
0005 <Comment># Read the documentation for more information on this configuration</Comment><br/>
0006 <Comment># file.  I've provided some comments here, but things may not be so</Comment><br/>
0007 <Comment># clear without further explanation.</Comment><br/>
0008 <Comment>#</Comment><br/>
0009 <Comment>#</Comment><br/>
0010 <Comment>##############################################################################</Comment><br/>
0011 <Variable></Variable><br/>
0012 <Variable></Variable><br/>
0013 <Comment># LOG FILE</Comment><br/>
0014 <Comment># This is the main log file where service and host events are logged</Comment><br/>
0015 <Comment># for historical purposes.  This should be the first option specified</Comment><br/>
0016 <Comment># in the config file!!!</Comment><br/>
0017 <Variable></Variable><br/>
0018 <Variable>log_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/nagios.log</Value><br/>
0019 <Variable></Variable><br/>
0020 <Variable></Variable><br/>
0021 <Variable></Variable><br/>
0022 <Comment># OBJECT CONFIGURATION FILE(S)</Comment><br/>
0023 <Comment># These are the object configuration files in which you define hosts,</Comment><br/>
0024 <Comment># host groups, contacts, contact groups, services, etc.</Comment><br/>
0025 <Comment># You can split your object definitions across several config files</Comment><br/>
0026 <Comment># if you wish (as shown below), or keep them all in a single config file.</Comment><br/>
0027 <Variable></Variable><br/>
0028 <Comment># You can specify individual object config files as shown below:</Comment><br/>
0029 <Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/commands.cfg</Value><br/>
0030 <Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/contacts.cfg</Value><br/>
0031 <Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/timeperiods.cfg</Value><br/>
0032 <Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/templates.cfg</Value><br/>
0033 <Variable></Variable><br/>
0034 <Comment># Definitions for monitoring the local (Linux) host</Comment><br/>
0035 <Variable>cfg_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/objects/localhost.cfg</Value><br/>
0036 <Variable></Variable><br/>
0037 <Comment># Definitions for monitoring a Windows machine</Comment><br/>
0038 <Comment>#cfg_file=@sysconfdir@/objects/windows.cfg</Comment><br/>
0039 <Variable></Variable><br/>
0040 <Comment># Definitions for monitoring a router/switch</Comment><br/>
0041 <Comment>#cfg_file=@sysconfdir@/objects/switch.cfg</Comment><br/>
0042 <Variable></Variable><br/>
0043 <Comment># Definitions for monitoring a network printer</Comment><br/>
0044 <Comment>#cfg_file=@sysconfdir@/objects/printer.cfg</Comment><br/>
0045 <Variable></Variable><br/>
0046 <Variable></Variable><br/>
0047 <Comment># You can also tell Nagios to process all config files (with a .cfg</Comment><br/>
0048 <Comment># extension) in a particular directory by using the cfg_dir</Comment><br/>
0049 <Comment># directive as shown below:</Comment><br/>
0050 <Variable></Variable><br/>
0051 <Comment>#cfg_dir=@sysconfdir@/servers</Comment><br/>
0052 <Comment>#cfg_dir=@sysconfdir@/printers</Comment><br/>
0053 <Comment>#cfg_dir=@sysconfdir@/switches</Comment><br/>
0054 <Comment>#cfg_dir=@sysconfdir@/routers</Comment><br/>
0055 <Variable></Variable><br/>
0056 <Variable></Variable><br/>
0057 <Variable></Variable><br/>
0058 <Variable></Variable><br/>
0059 <Comment># OBJECT CACHE FILE</Comment><br/>
0060 <Comment># This option determines where object definitions are cached when</Comment><br/>
0061 <Comment># Nagios starts/restarts.  The CGIs read object definitions from</Comment><br/>
0062 <Comment># this cache file (rather than looking at the object config files</Comment><br/>
0063 <Comment># directly) in order to prevent inconsistencies that can occur</Comment><br/>
0064 <Comment># when the config files are modified after Nagios starts.</Comment><br/>
0065 <Variable></Variable><br/>
0066 <Variable>object_cache_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/objects.cache</Value><br/>
0067 <Variable></Variable><br/>
0068 <Variable></Variable><br/>
0069 <Variable></Variable><br/>
0070 <Comment># PRE-CACHED OBJECT FILE</Comment><br/>
0071 <Comment># This options determines the location of the precached object file.</Comment><br/>
0072 <Comment># If you run Nagios with the -p command line option, it will preprocess</Comment><br/>
0073 <Comment># your object configuration file(s) and write the cached config to this</Comment><br/>
0074 <Comment># file.  You can then start Nagios with the -u option to have it read</Comment><br/>
0075 <Comment># object definitions from this precached file, rather than the standard</Comment><br/>
0076 <Comment># object configuration files (see the cfg_file and cfg_dir options above).</Comment><br/>
0077 <Comment># Using a precached object file can speed up the time needed to (re)start</Comment><br/>
0078 <Comment># the Nagios process if you've got a large and/or complex configuration.</Comment><br/>
0079 <Comment># Read the documentation section on optimizing Nagios to find our more</Comment><br/>
0080 <Comment># about how this feature works.</Comment><br/>
0081 <Variable></Variable><br/>
0082 <Variable>precached_object_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/objects.precache</Value><br/>
0083 <Variable></Variable><br/>
0084 <Variable></Variable><br/>
0085 <Variable></Variable><br/>
0086 <Comment># RESOURCE FILE</Comment><br/>
0087 <Comment># This is an optional resource file that contains $USERx$ macro</Comment><br/>
0088 <Comment># definitions. Multiple resource files can be specified by using</Comment><br/>
0089 <Comment># multiple resource_file definitions.  The CGIs will not attempt to</Comment><br/>
0090 <Comment># read the contents of resource files, so information that is</Comment><br/>
0091 <Comment># considered to be sensitive (usernames, passwords, etc) can be</Comment><br/>
0092 <Comment># defined as macros in this file and restrictive permissions (600)</Comment><br/>
0093 <Comment># can be placed on this file.</Comment><br/>
0094 <Variable></Variable><br/>
0095 <Variable>resource_file</Variable><Symbol>=</Symbol><Value>@sysconfdir@/resource.cfg</Value><br/>
0096 <Variable></Variable><br/>
0097 <Variable></Variable><br/>
0098 <Variable></Variable><br/>
0099 <Comment># STATUS FILE</Comment><br/>
0100 <Comment># This is where the current status of all monitored services and</Comment><br/>
0101 <Comment># hosts is stored.  Its contents are read and processed by the CGIs.</Comment><br/>
0102 <Comment># The contents of the status file are deleted every time Nagios</Comment><br/>
0103 <Comment>#  restarts.</Comment><br/>
0104 <Variable></Variable><br/>
0105 <Variable>status_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/status.dat</Value><br/>
0106 <Variable></Variable><br/>
0107 <Variable></Variable><br/>
0108 <Variable></Variable><br/>
0109 <Comment># STATUS FILE UPDATE INTERVAL</Comment><br/>
0110 <Comment># This option determines the frequency (in seconds) that</Comment><br/>
0111 <Comment># Nagios will periodically dump program, host, and</Comment><br/>
0112 <Comment># service status data.</Comment><br/>
0113 <Variable></Variable><br/>
0114 <Variable>status_update_interval</Variable><Symbol>=</Symbol><Int>10</Int><br/>
0115 <Variable></Variable><br/>
0116 <Variable></Variable><br/>
0117 <Variable></Variable><br/>
0118 <Comment># NAGIOS USER</Comment><br/>
0119 <Comment># This determines the effective user that Nagios should run as.</Comment><br/>
0120 <Comment># You can either supply a username or a UID.</Comment><br/>
0121 <Variable></Variable><br/>
0122 <Variable>nagios_user</Variable><Symbol>=</Symbol><Value>@nagios_user@</Value><br/>
0123 <Variable></Variable><br/>
0124 <Variable></Variable><br/>
0125 <Variable></Variable><br/>
0126 <Comment># NAGIOS GROUP</Comment><br/>
0127 <Comment># This determines the effective group that Nagios should run as.</Comment><br/>
0128 <Comment># You can either supply a group name or a GID.</Comment><br/>
0129 <Variable></Variable><br/>
0130 <Variable>nagios_group</Variable><Symbol>=</Symbol><Value>@nagios_grp@</Value><br/>
0131 <Variable></Variable><br/>
0132 <Variable></Variable><br/>
0133 <Variable></Variable><br/>
0134 <Comment># EXTERNAL COMMAND OPTION</Comment><br/>
0135 <Comment># This option allows you to specify whether or not Nagios should check</Comment><br/>
0136 <Comment># for external commands (in the command file defined below).</Comment><br/>
0137 <Comment># By default Nagios will check for external commands.</Comment><br/>
0138 <Comment># If you want to be able to use the CGI command interface</Comment><br/>
0139 <Comment># you will have to enable this.</Comment><br/>
0140 <Comment># Values: 0 = disable commands, 1 = enable commands</Comment><br/>
0141 <Variable></Variable><br/>
0142 <Variable>check_external_commands</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0143 <Variable></Variable><br/>
0144 <Variable></Variable><br/>
0145 <Variable></Variable><br/>
0146 <Comment># EXTERNAL COMMAND FILE</Comment><br/>
0147 <Comment># This is the file that Nagios checks for external command requests.</Comment><br/>
0148 <Comment># It is also where the command CGI will write commands that are submitted</Comment><br/>
0149 <Comment># by users, so it must be writeable by the user that the web server</Comment><br/>
0150 <Comment># is running as (usually 'nobody').  Permissions should be set at the</Comment><br/>
0151 <Comment># directory level instead of on the file, as the file is deleted every</Comment><br/>
0152 <Comment># time its contents are processed.</Comment><br/>
0153 <Variable></Variable><br/>
0154 <Variable>command_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/rw/nagios.cmd</Value><br/>
0155 <Variable></Variable><br/>
0156 <Variable></Variable><br/>
0157 <Variable></Variable><br/>
0158 <Comment># QUERY HANDLER INTERFACE</Comment><br/>
0159 <Comment># This is the socket that is created for the Query Handler interface</Comment><br/>
0160 <Variable></Variable><br/>
0161 <Comment>#query_socket=@localstatedir@/rw/nagios.qh</Comment><br/>
0162 <Variable></Variable><br/>
0163 <Variable></Variable><br/>
0164 <Variable></Variable><br/>
0165 <Comment># LOCK FILE</Comment><br/>
0166 <Comment># This is the lockfile that Nagios will use to store its PID number</Comment><br/>
0167 <Comment># in when it is running in daemon mode.</Comment><br/>
0168 <Variable></Variable><br/>
0169 <Variable>lock_file</Variable><Symbol>=</Symbol><Value>@subsyslockfile@</Value><br/>
0170 <Variable></Variable><br/>
0171 <Variable></Variable><br/>
0172 <Variable></Variable><br/>
0173 <Comment># TEMP FILE</Comment><br/>
0174 <Comment># This is a temporary file that is used as scratch space when Nagios</Comment><br/>
0175 <Comment># updates the status log, cleans the comment file, etc.  This file</Comment><br/>
0176 <Comment># is created, used, and deleted throughout the time that Nagios is</Comment><br/>
0177 <Comment># running.</Comment><br/>
0178 <Variable></Variable><br/>
0179 <Variable>temp_file</Variable><Symbol>=</Symbol><Value>@localstatedir@/nagios.tmp</Value><br/>
0180 <Variable></Variable><br/>
0181 <Variable></Variable><br/>
0182 <Variable></Variable><br/>
0183 <Comment># TEMP PATH</Comment><br/>
0184 <Comment># This is path where Nagios can create temp files for service and</Comment><br/>
0185 <Comment># host check results, etc.</Comment><br/>
0186 <Variable></Variable><br/>
0187 <Variable>temp_path</Variable><Symbol>=</Symbol><Value>@TMPDIR@</Value><br/>
0188 <Variable></Variable><br/>
0189 <Variable></Variable><br/>
0190 <Variable></Variable><br/>
0191 <Comment># EVENT BROKER OPTIONS</Comment><br/>
0192 <Comment># Controls what (if any) data gets sent to the event broker.</Comment><br/>
0193 <Comment># Values:  0      = Broker nothing</Comment><br/>
0194 <Comment>#         -1      = Broker everything</Comment><br/>
0195 <Comment>#         <other> = See documentation</Comment><br/>
0196 <Variable></Variable><br/>
0197 <Variable>event_broker_options</Variable><Symbol>=</Symbol><Value>-</Value><Int>1</Int><br/>
0198 <Variable></Variable><br/>
0199 <Variable></Variable><br/>
0200 <Variable></Variable><br/>
0201 <Comment># EVENT BROKER MODULE(S)</Comment><br/>
0202 <Comment># This directive is used to specify an event broker module that should</Comment><br/>
0203 <Comment># by loaded by Nagios at startup.  Use multiple directives if you want</Comment><br/>
0204 <Comment># to load more than one module.  Arguments that should be passed to</Comment><br/>
0205 <Comment># the module at startup are separated from the module path by a space.</Comment><br/>
0206 <Comment>#</Comment><br/>
0207 <Comment>#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</Comment><br/>
0208 <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/>
0209 <Comment>#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</Comment><br/>
0210 <Comment>#</Comment><br/>
0211 <Comment># Do NOT overwrite modules while they are being used by Nagios or Nagios</Comment><br/>
0212 <Comment># will crash in a fiery display of SEGFAULT glory.  This is a bug/limitation</Comment><br/>
0213 <Comment># either in dlopen(), the kernel, and/or the filesystem.  And maybe Nagios...</Comment><br/>
0214 <Comment>#</Comment><br/>
0215 <Comment># The correct/safe way of updating a module is by using one of these methods:</Comment><br/>
0216 <Comment>#    1. Shutdown Nagios, replace the module file, restart Nagios</Comment><br/>
0217 <Comment>#    2. Delete the original module file, move the new module file into place,</Comment><br/>
0218 <Comment>#      restart Nagios</Comment><br/>
0219 <Comment>#</Comment><br/>
0220 <Comment># Example:</Comment><br/>
0221 <Comment>#</Comment><br/>
0222 <Comment>#   broker_module=<modulepath> [moduleargs]</Comment><br/>
0223 <Variable></Variable><br/>
0224 <Comment>#broker_module=/somewhere/module1.o</Comment><br/>
0225 <Comment>#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0</Comment><br/>
0226 <Variable></Variable><br/>
0227 <Variable></Variable><br/>
0228 <Variable></Variable><br/>
0229 <Comment># LOG ROTATION METHOD</Comment><br/>
0230 <Comment># This is the log rotation method that Nagios should use to rotate</Comment><br/>
0231 <Comment># the main log file. Values are as follows..</Comment><br/>
0232 <Comment>#      n       = None - don't rotate the log</Comment><br/>
0233 <Comment>#      h       = Hourly rotation (top of the hour)</Comment><br/>
0234 <Comment>#      d       = Daily rotation (midnight every day)</Comment><br/>
0235 <Comment>#      w       = Weekly rotation (midnight on Saturday evening)</Comment><br/>
0236 <Comment>#      m       = Monthly rotation (midnight last day of month)</Comment><br/>
0237 <Variable></Variable><br/>
0238 <Variable>log_rotation_method</Variable><Symbol>=</Symbol><Value>d</Value><br/>
0239 <Variable></Variable><br/>
0240 <Variable></Variable><br/>
0241 <Variable></Variable><br/>
0242 <Comment># LOG ARCHIVE PATH</Comment><br/>
0243 <Comment># This is the directory where archived (rotated) log files should be</Comment><br/>
0244 <Comment># placed (assuming you've chosen to do log rotation).</Comment><br/>
0245 <Variable></Variable><br/>
0246 <Variable>log_archive_path</Variable><Symbol>=</Symbol><Value>@localstatedir@/archives</Value><br/>
0247 <Variable></Variable><br/>
0248 <Variable></Variable><br/>
0249 <Variable></Variable><br/>
0250 <Comment># LOGGING OPTIONS</Comment><br/>
0251 <Comment># If you want messages logged to the syslog facility, as well as the</Comment><br/>
0252 <Comment># Nagios log file set this option to 1.  If not, set it to 0.</Comment><br/>
0253 <Variable></Variable><br/>
0254 <Variable>use_syslog</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0255 <Variable></Variable><br/>
0256 <Variable></Variable><br/>
0257 <Variable></Variable><br/>
0258 <Comment># NOTIFICATION LOGGING OPTION</Comment><br/>
0259 <Comment># If you don't want notifications to be logged, set this value to 0.</Comment><br/>
0260 <Comment># If notifications should be logged, set the value to 1.</Comment><br/>
0261 <Variable></Variable><br/>
0262 <Variable>log_notifications</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0263 <Variable></Variable><br/>
0264 <Variable></Variable><br/>
0265 <Variable></Variable><br/>
0266 <Comment># SERVICE RETRY LOGGING OPTION</Comment><br/>
0267 <Comment># If you don't want service check retries to be logged, set this value</Comment><br/>
0268 <Comment># to 0.  If retries should be logged, set the value to 1.</Comment><br/>
0269 <Variable></Variable><br/>
0270 <Variable>log_service_retries</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0271 <Variable></Variable><br/>
0272 <Variable></Variable><br/>
0273 <Variable></Variable><br/>
0274 <Comment># HOST RETRY LOGGING OPTION</Comment><br/>
0275 <Comment># If you don't want host check retries to be logged, set this value to</Comment><br/>
0276 <Comment># 0.  If retries should be logged, set the value to 1.</Comment><br/>
0277 <Variable></Variable><br/>
0278 <Variable>log_host_retries</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0279 <Variable></Variable><br/>
0280 <Variable></Variable><br/>
0281 <Variable></Variable><br/>
0282 <Comment># EVENT HANDLER LOGGING OPTION</Comment><br/>
0283 <Comment># If you don't want host and service event handlers to be logged, set</Comment><br/>
0284 <Comment># this value to 0.  If event handlers should be logged, set the value</Comment><br/>
0285 <Comment># to 1.</Comment><br/>
0286 <Variable></Variable><br/>
0287 <Variable>log_event_handlers</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0288 <Variable></Variable><br/>
0289 <Variable></Variable><br/>
0290 <Variable></Variable><br/>
0291 <Comment># INITIAL STATES LOGGING OPTION</Comment><br/>
0292 <Comment># If you want Nagios to log all initial host and service states to</Comment><br/>
0293 <Comment># the main log file (the first time the service or host is checked)</Comment><br/>
0294 <Comment># you can enable this option by setting this value to 1.  If you</Comment><br/>
0295 <Comment># are not using an external application that does long term state</Comment><br/>
0296 <Comment># statistics reporting, you do not need to enable this option.  In</Comment><br/>
0297 <Comment># this case, set the value to 0.</Comment><br/>
0298 <Variable></Variable><br/>
0299 <Variable>log_initial_states</Variable><Symbol>=</Symbol><Int>0</Int><br/>
0300 <Variable></Variable><br/>
0301 <Variable></Variable><br/>
0302 <Variable></Variable><br/>
0303 <Comment># CURRENT STATES LOGGING OPTION</Comment><br/>
0304 <Comment># If you don't want Nagios to log all current host and service states</Comment><br/>
0305 <Comment># after log has been rotated to the main log file, you can disable this</Comment><br/>
0306 <Comment># option by setting this value to 0. Default value is 1.</Comment><br/>
0307 <Variable></Variable><br/>
0308 <Variable>log_current_states</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0309 <Variable></Variable><br/>
0310 <Variable></Variable><br/>
0311 <Variable></Variable><br/>
0312 <Comment># EXTERNAL COMMANDS LOGGING OPTION</Comment><br/>
0313 <Comment># If you don't want Nagios to log external commands, set this value</Comment><br/>
0314 <Comment># to 0.  If external commands should be logged, set this value to 1.</Comment><br/>
0315 <Comment># Note: This option does not include logging of passive service</Comment><br/>
0316 <Comment># checks - see the option below for controlling whether or not</Comment><br/>
0317 <Comment># passive checks are logged.</Comment><br/>
0318 <Variable></Variable><br/>
0319 <Variable>log_external_commands</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0320 <Variable></Variable><br/>
0321 <Variable></Variable><br/>
0322 <Variable></Variable><br/>
0323 <Comment># PASSIVE CHECKS LOGGING OPTION</Comment><br/>
0324 <Comment># If you don't want Nagios to log passive host and service checks, set</Comment><br/>
0325 <Comment># this value to 0.  If passive checks should be logged, set</Comment><br/>
0326 <Comment># this value to 1.</Comment><br/>
0327 <Variable></Variable><br/>
0328 <Variable>log_passive_checks</Variable><Symbol>=</Symbol><Int>1</Int><br/>
0329 <Variable></Variable><br/>
0330 <Variable></Variable><br/>
0331 <Variable></Variable><br/>
0332 <Comment># GLOBAL HOST AND SERVICE EVENT HANDLERS</Comment><br/>
0333 <Comment># These options allow you to specify a host and service event handler</Comment><br/>
0334 <Comment># command that is to be run for every host or service state change.</Comment><br/>
0335 <Comment># The global event handler is executed immediately prior to the event</Comment><br/>
0336 <Comment># handler that you have optionally specified in each host or</Comment><br/>
0337 <Comment># service definition. The command argument is the short name of a</Comment><br/>
0338 <Comment># command definition that you define in your host configuration file.</Comment><br/>
0339 <Comment># Read the HTML docs for more information.</Comment><br/>
0340 <Variable></Variable><br/>
0341 <Comment>#global_host_event_handler=somecommand</Comment><br/>
0342 <Comment>#global_service_event_handler=somecommand</Comment><br/>