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