1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
|
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>nagios.cfg</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (Nagios) - Theme (Breeze Light)"/>
</head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
<span style="color:#898887">##############################################################################</span>
<span style="color:#898887">#</span>
<span style="color:#898887"># NAGIOS.CFG - Sample Main Config File for Nagios @VERSION@</span>
<span style="color:#898887">#</span>
<span style="color:#898887"># Read the documentation for more information on this configuration</span>
<span style="color:#898887"># file. I've provided some comments here, but things may not be so</span>
<span style="color:#898887"># clear without further explanation.</span>
<span style="color:#898887">#</span>
<span style="color:#898887">#</span>
<span style="color:#898887">##############################################################################</span>
<span style="color:#898887"># LOG FILE</span>
<span style="color:#898887"># This is the main log file where service and host events are logged</span>
<span style="color:#898887"># for historical purposes. This should be the first option specified</span>
<span style="color:#898887"># in the config file!!!</span>
log_file<span style="color:#006e28">=</span><span style="color:#bf0303">@localstatedir@/nagios.log</span>
<span style="color:#898887"># OBJECT CONFIGURATION FILE(S)</span>
<span style="color:#898887"># These are the object configuration files in which you define hosts,</span>
<span style="color:#898887"># host groups, contacts, contact groups, services, etc.</span>
<span style="color:#898887"># You can split your object definitions across several config files</span>
<span style="color:#898887"># if you wish (as shown below), or keep them all in a single config file.</span>
<span style="color:#898887"># You can specify individual object config files as shown below:</span>
cfg_file<span style="color:#006e28">=</span><span style="color:#bf0303">@sysconfdir@/objects/commands.cfg</span>
cfg_file<span style="color:#006e28">=</span><span style="color:#bf0303">@sysconfdir@/objects/contacts.cfg</span>
cfg_file<span style="color:#006e28">=</span><span style="color:#bf0303">@sysconfdir@/objects/timeperiods.cfg</span>
cfg_file<span style="color:#006e28">=</span><span style="color:#bf0303">@sysconfdir@/objects/templates.cfg</span>
<span style="color:#898887"># Definitions for monitoring the local (Linux) host</span>
cfg_file<span style="color:#006e28">=</span><span style="color:#bf0303">@sysconfdir@/objects/localhost.cfg</span>
<span style="color:#898887"># Definitions for monitoring a Windows machine</span>
<span style="color:#898887">#cfg_file=@sysconfdir@/objects/windows.cfg</span>
<span style="color:#898887"># Definitions for monitoring a router/switch</span>
<span style="color:#898887">#cfg_file=@sysconfdir@/objects/switch.cfg</span>
<span style="color:#898887"># Definitions for monitoring a network printer</span>
<span style="color:#898887">#cfg_file=@sysconfdir@/objects/printer.cfg</span>
<span style="color:#898887"># You can also tell Nagios to process all config files (with a .cfg</span>
<span style="color:#898887"># extension) in a particular directory by using the cfg_dir</span>
<span style="color:#898887"># directive as shown below:</span>
<span style="color:#898887">#cfg_dir=@sysconfdir@/servers</span>
<span style="color:#898887">#cfg_dir=@sysconfdir@/printers</span>
<span style="color:#898887">#cfg_dir=@sysconfdir@/switches</span>
<span style="color:#898887">#cfg_dir=@sysconfdir@/routers</span>
<span style="color:#898887"># OBJECT CACHE FILE</span>
<span style="color:#898887"># This option determines where object definitions are cached when</span>
<span style="color:#898887"># Nagios starts/restarts. The CGIs read object definitions from</span>
<span style="color:#898887"># this cache file (rather than looking at the object config files</span>
<span style="color:#898887"># directly) in order to prevent inconsistencies that can occur</span>
<span style="color:#898887"># when the config files are modified after Nagios starts.</span>
object_cache_file<span style="color:#006e28">=</span><span style="color:#bf0303">@localstatedir@/objects.cache</span>
<span style="color:#898887"># PRE-CACHED OBJECT FILE</span>
<span style="color:#898887"># This options determines the location of the precached object file.</span>
<span style="color:#898887"># If you run Nagios with the -p command line option, it will preprocess</span>
<span style="color:#898887"># your object configuration file(s) and write the cached config to this</span>
<span style="color:#898887"># file. You can then start Nagios with the -u option to have it read</span>
<span style="color:#898887"># object definitions from this precached file, rather than the standard</span>
<span style="color:#898887"># object configuration files (see the cfg_file and cfg_dir options above).</span>
<span style="color:#898887"># Using a precached object file can speed up the time needed to (re)start</span>
<span style="color:#898887"># the Nagios process if you've got a large and/or complex configuration.</span>
<span style="color:#898887"># Read the documentation section on optimizing Nagios to find our more</span>
<span style="color:#898887"># about how this feature works.</span>
precached_object_file<span style="color:#006e28">=</span><span style="color:#bf0303">@localstatedir@/objects.precache</span>
<span style="color:#898887"># RESOURCE FILE</span>
<span style="color:#898887"># This is an optional resource file that contains $USERx$ macro</span>
<span style="color:#898887"># definitions. Multiple resource files can be specified by using</span>
<span style="color:#898887"># multiple resource_file definitions. The CGIs will not attempt to</span>
<span style="color:#898887"># read the contents of resource files, so information that is</span>
<span style="color:#898887"># considered to be sensitive (usernames, passwords, etc) can be</span>
<span style="color:#898887"># defined as macros in this file and restrictive permissions (600)</span>
<span style="color:#898887"># can be placed on this file.</span>
resource_file<span style="color:#006e28">=</span><span style="color:#bf0303">@sysconfdir@/resource.cfg</span>
<span style="color:#898887"># STATUS FILE</span>
<span style="color:#898887"># This is where the current status of all monitored services and</span>
<span style="color:#898887"># hosts is stored. Its contents are read and processed by the CGIs.</span>
<span style="color:#898887"># The contents of the status file are deleted every time Nagios</span>
<span style="color:#898887"># restarts.</span>
status_file<span style="color:#006e28">=</span><span style="color:#bf0303">@localstatedir@/status.dat</span>
<span style="color:#898887"># STATUS FILE UPDATE INTERVAL</span>
<span style="color:#898887"># This option determines the frequency (in seconds) that</span>
<span style="color:#898887"># Nagios will periodically dump program, host, and</span>
<span style="color:#898887"># service status data.</span>
status_update_interval<span style="color:#006e28">=</span><span style="color:#b08000">10</span>
<span style="color:#898887"># NAGIOS USER</span>
<span style="color:#898887"># This determines the effective user that Nagios should run as.</span>
<span style="color:#898887"># You can either supply a username or a UID.</span>
nagios_user<span style="color:#006e28">=</span><span style="color:#bf0303">@nagios_user@</span>
<span style="color:#898887"># NAGIOS GROUP</span>
<span style="color:#898887"># This determines the effective group that Nagios should run as.</span>
<span style="color:#898887"># You can either supply a group name or a GID.</span>
nagios_group<span style="color:#006e28">=</span><span style="color:#bf0303">@nagios_grp@</span>
<span style="color:#898887"># EXTERNAL COMMAND OPTION</span>
<span style="color:#898887"># This option allows you to specify whether or not Nagios should check</span>
<span style="color:#898887"># for external commands (in the command file defined below).</span>
<span style="color:#898887"># By default Nagios will check for external commands.</span>
<span style="color:#898887"># If you want to be able to use the CGI command interface</span>
<span style="color:#898887"># you will have to enable this.</span>
<span style="color:#898887"># Values: 0 = disable commands, 1 = enable commands</span>
check_external_commands<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># EXTERNAL COMMAND FILE</span>
<span style="color:#898887"># This is the file that Nagios checks for external command requests.</span>
<span style="color:#898887"># It is also where the command CGI will write commands that are submitted</span>
<span style="color:#898887"># by users, so it must be writeable by the user that the web server</span>
<span style="color:#898887"># is running as (usually 'nobody'). Permissions should be set at the</span>
<span style="color:#898887"># directory level instead of on the file, as the file is deleted every</span>
<span style="color:#898887"># time its contents are processed.</span>
command_file<span style="color:#006e28">=</span><span style="color:#bf0303">@localstatedir@/rw/nagios.cmd</span>
<span style="color:#898887"># QUERY HANDLER INTERFACE</span>
<span style="color:#898887"># This is the socket that is created for the Query Handler interface</span>
<span style="color:#898887">#query_socket=@localstatedir@/rw/nagios.qh</span>
<span style="color:#898887"># LOCK FILE</span>
<span style="color:#898887"># This is the lockfile that Nagios will use to store its PID number</span>
<span style="color:#898887"># in when it is running in daemon mode.</span>
lock_file<span style="color:#006e28">=</span><span style="color:#bf0303">@subsyslockfile@</span>
<span style="color:#898887"># TEMP FILE</span>
<span style="color:#898887"># This is a temporary file that is used as scratch space when Nagios</span>
<span style="color:#898887"># updates the status log, cleans the comment file, etc. This file</span>
<span style="color:#898887"># is created, used, and deleted throughout the time that Nagios is</span>
<span style="color:#898887"># running.</span>
temp_file<span style="color:#006e28">=</span><span style="color:#bf0303">@localstatedir@/nagios.tmp</span>
<span style="color:#898887"># TEMP PATH</span>
<span style="color:#898887"># This is path where Nagios can create temp files for service and</span>
<span style="color:#898887"># host check results, etc.</span>
temp_path<span style="color:#006e28">=</span><span style="color:#bf0303">@TMPDIR@</span>
<span style="color:#898887"># EVENT BROKER OPTIONS</span>
<span style="color:#898887"># Controls what (if any) data gets sent to the event broker.</span>
<span style="color:#898887"># Values: 0 = Broker nothing</span>
<span style="color:#898887"># -1 = Broker everything</span>
<span style="color:#898887"># <other> = See documentation</span>
event_broker_options<span style="color:#006e28">=</span><span style="color:#bf0303">-</span><span style="color:#b08000">1</span>
<span style="color:#898887"># EVENT BROKER MODULE(S)</span>
<span style="color:#898887"># This directive is used to specify an event broker module that should</span>
<span style="color:#898887"># by loaded by Nagios at startup. Use multiple directives if you want</span>
<span style="color:#898887"># to load more than one module. Arguments that should be passed to</span>
<span style="color:#898887"># the module at startup are separated from the module path by a space.</span>
<span style="color:#898887">#</span>
<span style="color:#898887">#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span>
<span style="color:#898887"># </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold">WARNING</span><span style="color:#898887"> !!! </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold">WARNING</span><span style="color:#898887"> !!! </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold">WARNING</span><span style="color:#898887"> !!! </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold">WARNING</span><span style="color:#898887"> !!! </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold">WARNING</span><span style="color:#898887"> !!! </span><span style="color:#ca9219;background-color:#451e1a;font-weight:bold">WARNING</span>
<span style="color:#898887">#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span>
<span style="color:#898887">#</span>
<span style="color:#898887"># Do NOT overwrite modules while they are being used by Nagios or Nagios</span>
<span style="color:#898887"># will crash in a fiery display of SEGFAULT glory. This is a bug/limitation</span>
<span style="color:#898887"># either in dlopen(), the kernel, and/or the filesystem. And maybe Nagios...</span>
<span style="color:#898887">#</span>
<span style="color:#898887"># The correct/safe way of updating a module is by using one of these methods:</span>
<span style="color:#898887"># 1. Shutdown Nagios, replace the module file, restart Nagios</span>
<span style="color:#898887"># 2. Delete the original module file, move the new module file into place,</span>
<span style="color:#898887"># restart Nagios</span>
<span style="color:#898887">#</span>
<span style="color:#898887"># Example:</span>
<span style="color:#898887">#</span>
<span style="color:#898887"># broker_module=<modulepath> [moduleargs]</span>
<span style="color:#898887">#broker_module=/somewhere/module1.o</span>
<span style="color:#898887">#broker_module=/somewhere/module2.o arg1 arg2=3 debug=0</span>
<span style="color:#898887"># LOG ROTATION METHOD</span>
<span style="color:#898887"># This is the log rotation method that Nagios should use to rotate</span>
<span style="color:#898887"># the main log file. Values are as follows..</span>
<span style="color:#898887"># n = None - don't rotate the log</span>
<span style="color:#898887"># h = Hourly rotation (top of the hour)</span>
<span style="color:#898887"># d = Daily rotation (midnight every day)</span>
<span style="color:#898887"># w = Weekly rotation (midnight on Saturday evening)</span>
<span style="color:#898887"># m = Monthly rotation (midnight last day of month)</span>
log_rotation_method<span style="color:#006e28">=</span><span style="color:#bf0303">d</span>
<span style="color:#898887"># LOG ARCHIVE PATH</span>
<span style="color:#898887"># This is the directory where archived (rotated) log files should be</span>
<span style="color:#898887"># placed (assuming you've chosen to do log rotation).</span>
log_archive_path<span style="color:#006e28">=</span><span style="color:#bf0303">@localstatedir@/archives</span>
<span style="color:#898887"># LOGGING OPTIONS</span>
<span style="color:#898887"># If you want messages logged to the syslog facility, as well as the</span>
<span style="color:#898887"># Nagios log file set this option to 1. If not, set it to 0.</span>
use_syslog<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># NOTIFICATION LOGGING OPTION</span>
<span style="color:#898887"># If you don't want notifications to be logged, set this value to 0.</span>
<span style="color:#898887"># If notifications should be logged, set the value to 1.</span>
log_notifications<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># SERVICE RETRY LOGGING OPTION</span>
<span style="color:#898887"># If you don't want service check retries to be logged, set this value</span>
<span style="color:#898887"># to 0. If retries should be logged, set the value to 1.</span>
log_service_retries<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># HOST RETRY LOGGING OPTION</span>
<span style="color:#898887"># If you don't want host check retries to be logged, set this value to</span>
<span style="color:#898887"># 0. If retries should be logged, set the value to 1.</span>
log_host_retries<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># EVENT HANDLER LOGGING OPTION</span>
<span style="color:#898887"># If you don't want host and service event handlers to be logged, set</span>
<span style="color:#898887"># this value to 0. If event handlers should be logged, set the value</span>
<span style="color:#898887"># to 1.</span>
log_event_handlers<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># INITIAL STATES LOGGING OPTION</span>
<span style="color:#898887"># If you want Nagios to log all initial host and service states to</span>
<span style="color:#898887"># the main log file (the first time the service or host is checked)</span>
<span style="color:#898887"># you can enable this option by setting this value to 1. If you</span>
<span style="color:#898887"># are not using an external application that does long term state</span>
<span style="color:#898887"># statistics reporting, you do not need to enable this option. In</span>
<span style="color:#898887"># this case, set the value to 0.</span>
log_initial_states<span style="color:#006e28">=</span><span style="color:#b08000">0</span>
<span style="color:#898887"># CURRENT STATES LOGGING OPTION</span>
<span style="color:#898887"># If you don't want Nagios to log all current host and service states</span>
<span style="color:#898887"># after log has been rotated to the main log file, you can disable this</span>
<span style="color:#898887"># option by setting this value to 0. Default value is 1.</span>
log_current_states<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># EXTERNAL COMMANDS LOGGING OPTION</span>
<span style="color:#898887"># If you don't want Nagios to log external commands, set this value</span>
<span style="color:#898887"># to 0. If external commands should be logged, set this value to 1.</span>
<span style="color:#898887"># Note: This option does not include logging of passive service</span>
<span style="color:#898887"># checks - see the option below for controlling whether or not</span>
<span style="color:#898887"># passive checks are logged.</span>
log_external_commands<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># PASSIVE CHECKS LOGGING OPTION</span>
<span style="color:#898887"># If you don't want Nagios to log passive host and service checks, set</span>
<span style="color:#898887"># this value to 0. If passive checks should be logged, set</span>
<span style="color:#898887"># this value to 1.</span>
log_passive_checks<span style="color:#006e28">=</span><span style="color:#b08000">1</span>
<span style="color:#898887"># GLOBAL HOST AND SERVICE EVENT HANDLERS</span>
<span style="color:#898887"># These options allow you to specify a host and service event handler</span>
<span style="color:#898887"># command that is to be run for every host or service state change.</span>
<span style="color:#898887"># The global event handler is executed immediately prior to the event</span>
<span style="color:#898887"># handler that you have optionally specified in each host or</span>
<span style="color:#898887"># service definition. The command argument is the short name of a</span>
<span style="color:#898887"># command definition that you define in your host configuration file.</span>
<span style="color:#898887"># Read the HTML docs for more information.</span>
<span style="color:#898887">#global_host_event_handler=somecommand</span>
<span style="color:#898887">#global_service_event_handler=somecommand</span>
</pre></body></html>
|