ruby-nagios 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,14 +60,14 @@ Dmytro Kovalov, dmytro.kovalov@gmail.com
60
60
  # @param [String] path UNIX path to the objects.cache file
61
61
  # @see Nagios::Objects.parse
62
62
  def initialize path
63
- raise "File does not exist" unless File.exist? path
64
- raise "File is not readable" unless File.readable? path
65
- @objects_file = path
63
+ raise "File #{path} does not exist" unless File.exist? path
64
+ raise "File #{path} is not readable" unless File.readable? path
65
+ @path = path
66
66
  @objects = {}
67
67
  end
68
68
 
69
69
  # PATH to the objects.cache file
70
- attr_accessor :objects_file
70
+ attr_accessor :path
71
71
 
72
72
  # Parsed objects
73
73
  attr_accessor :objects
@@ -78,7 +78,7 @@ Dmytro Kovalov, dmytro.kovalov@gmail.com
78
78
  Read objects.cache file and parse it.
79
79
 
80
80
  Method reads file by blocks. Each block defines one object, definition
81
- starts with 'define <type> {' and ends with '}'. Each block has a
81
+ starts with 'define <type> !{' and ends with '}'. Each block has a
82
82
  '<type>_name' line which defines name of the instance of the
83
83
  object.
84
84
 
@@ -110,7 +110,7 @@ parsing. Same property can be accessed either using Hash @objects
110
110
  =end
111
111
  def parse
112
112
  block = {}
113
- content = File.readlines objects_file
113
+ content = File.readlines path
114
114
  handler = nil
115
115
  content.each do |line|
116
116
  case
@@ -143,7 +143,8 @@ parsing. Same property can be accessed either using Hash @objects
143
143
  # @param [Symbol] resource Resource to search from: :host, :hostgroup, etc.
144
144
  # @param [Symbol] attribute Attribute to use in search. For example, find host by hostname or address, etc. anything that's defined for this resource
145
145
  # @param [Symbol] message Is either 'find' or 'find_all' passed from caller. In case of 'find' returns 1 hash, 'find_all' - Array of Hash'es.
146
- # @param [String] or [Regexp] pattern Search pattern
146
+ #
147
+ # @param [String, Regexp] pattern Search pattern
147
148
 
148
149
  def find resource, message, attribute, pattern
149
150
  self.send(resource.to_sym).values.send(message) do |a|
@@ -166,9 +167,9 @@ parsing. Same property can be accessed either using Hash @objects
166
167
  # @param [Symbol] sym Should be in the form
167
168
  # find(_all)?_<resource>_by_<attribute>. Similar to
168
169
  # ActiveResource find_* dynamic methods. Depending on the name
169
- # of the mthod called (find or find_all) will pass message to
170
- # self.find method, that will call {Array.find} or
171
- # {Array.find_all} accordingly.
170
+ # of the method called (find or find_all) will pass message to
171
+ # self.find method, that will call Array#find or
172
+ # Array.find_all accordingly.
172
173
  #
173
174
  # find_*_by and find_all_*. find_all returns Array of
174
175
  # hashes.
data/lib/nagios/status.rb CHANGED
@@ -1,16 +1,30 @@
1
1
  module Nagios
2
2
  class Status
3
- attr_reader :status
3
+ attr_reader :status, :path
4
+
5
+
6
+ def initialize(statusfile=nil)
7
+ if statusfile
8
+ raise ArgumentError, "Statusfile file name must be provided" unless statusfile
9
+ raise RuntimeError, "Statusfile #{statusfile} does not exist" unless File.exist? statusfile
10
+ raise RuntimeError, "Statusfile #{statusfile} is not readable" unless File.readable? statusfile
11
+ @path = statusfile
12
+ end
13
+ @status = {'hosts' => { }}
14
+
15
+ self
16
+ end
4
17
 
5
18
  # Parses a nagios status file returning a data structure for all the data
6
- def parsestatus(statusfile)
7
- @status = {}
8
- @status["hosts"] = {}
19
+ def parsestatus path=nil
9
20
 
10
- handler = ""
11
- blocklines = []
21
+ path ||= @path
22
+ raise ArgumentError, "Statusfile file name must be provided either in constructor or as argument to parsestatus method" unless path
23
+
24
+ @status, handler, blocklines = {'hosts' => {}}, '', []
25
+
26
+ File.readlines(path).each do |line|
12
27
 
13
- File.readlines(statusfile).each do |line|
14
28
  # start of new sections
15
29
  if line =~ /(\w+) \{/
16
30
  blocklines = []
@@ -25,12 +39,15 @@ module Nagios
25
39
 
26
40
  # end of a section
27
41
  if line =~ /\}/ && handler != "" && self.respond_to?("handle_#{handler}", include_private = true)
28
- eval("handle_#{handler}(blocklines)")
42
+ self.send "handle_#{handler}".to_sym, blocklines
29
43
  handler = ""
30
44
  end
31
45
  end
46
+ self
32
47
  end
33
48
 
49
+ alias :parse :parsestatus
50
+
34
51
  # Returns a list of all hosts matching the options in options
35
52
  def find_hosts(options = {})
36
53
  forhost = options.fetch(:forhost, [])
@@ -70,6 +87,8 @@ module Nagios
70
87
  notifications = options.fetch(:notifyenabled, nil)
71
88
  action = options.fetch(:action, nil)
72
89
  withservice = options.fetch(:withservice, [])
90
+ acknowledged = options.fetch(:acknowledged, nil)
91
+ passive = options.fetch(:passive, nil)
73
92
 
74
93
  services = []
75
94
  searchquery = []
@@ -85,6 +104,11 @@ module Nagios
85
104
  end
86
105
 
87
106
  searchquery << {"notifications_enabled" => notifications.to_s} if notifications
107
+ searchquery << {"problem_has_been_acknowledged" => acknowledged.to_s} if acknowledged
108
+ if passive
109
+ searchquery << {"active_checks_enabled" => 0}
110
+ searchquery << {"passive_checks_enabled" => 1}
111
+ end
88
112
 
89
113
  svcs = find_with_properties(searchquery)
90
114
 
@@ -333,3 +357,5 @@ module Nagios
333
357
  end
334
358
  end
335
359
  end
360
+
361
+ # vi:tabstop=2:expandtab:ai:filetype=ruby
data/lib/nagios.rb CHANGED
@@ -1,4 +1,17 @@
1
+ module Nagios
2
+
3
+ DEFAULT = {
4
+ :nagios_cfg_glob => ENV['NAGIOS_CFG_FILE'] ||
5
+ [
6
+ "/etc/nagios*/nagios.cfg",
7
+ "/usr/local/nagios/etc/nagios.cfg"
8
+ ]
9
+ }
10
+
11
+ end
12
+
1
13
  require 'nagios/config'
14
+ require 'nagios/external_commands'
2
15
  require 'nagios/objects'
3
16
  require 'nagios/status'
4
17
 
@@ -7,3 +20,5 @@ class String
7
20
  alias_method :each, :each_line
8
21
  end
9
22
  end
23
+ $: << File.dirname(__FILE__)
24
+
data/ruby-nagios.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'ruby-nagios'
3
- s.version = "0.0.2"
3
+ s.version = "0.1.0"
4
4
  s.author = 'R.I.Pienaar'
5
5
  s.email = 'rip@devco.net'
6
6
  s.homepage = 'http://devco.net/'
@@ -0,0 +1,79 @@
1
+ require_relative '../lib/nagios'
2
+ require_relative 'spec_helper'
3
+
4
+ describe "Configuration" do
5
+
6
+ before {
7
+ @cfg = Nagios::Config.new ::TEST[:nagios_cfg]
8
+ }
9
+
10
+ context "nagios.cfg" do
11
+
12
+ it { File.should exist @cfg.path }
13
+
14
+ it "should be parseable" do
15
+ lambda { @cfg.parse }.should_not raise_error
16
+ end
17
+
18
+ context "parsing nagios.cfg file" do
19
+
20
+ before { @cfg.parse }
21
+
22
+ it "should have PATH to objects file" do
23
+ @cfg.object_cache_file.should be_a_kind_of String
24
+ end
25
+
26
+ it "should have PATH to status file" do
27
+ @cfg.status_file.should be_a_kind_of String
28
+ end
29
+
30
+ end # parsing nagios.cfg file
31
+ end # nagios.cfg
32
+
33
+ context "data files" do
34
+ before { @cfg.parse }
35
+
36
+ context Nagios::Status do
37
+
38
+ context "OOP style" do
39
+ subject { Nagios::Status.new( ::TEST[:status_file] || @cfg.status_file ) }
40
+
41
+ it { File.should exist( subject.path ) }
42
+
43
+ it "should be parseable" do
44
+ lambda { subject.parse }.should_not raise_error
45
+ end
46
+ end
47
+
48
+ context "using parameter for parse method" do
49
+ subject { Nagios::Status.new() }
50
+
51
+ it { File.should exist( (::TEST[:status_file] || @cfg.status_file) ) }
52
+
53
+ it "should be parseable" do
54
+ lambda { subject.parse(::TEST[:status_file] || @cfg.status_file) }.should_not raise_error
55
+ end
56
+
57
+ it "should fail without a filename" do
58
+ lambda { subject.parse() }.should raise_error
59
+ end
60
+
61
+ end
62
+
63
+ end # Nagios::Status
64
+
65
+
66
+ context Nagios::Objects do
67
+
68
+ subject { Nagios::Objects.new( ::TEST[:object_cache_file] || @cfg.object_cache_file) }
69
+
70
+ it { File.should exist subject.path }
71
+
72
+ it "should be parseable" do
73
+ lambda { subject.parse }.should_not raise_error
74
+ end
75
+ end # Nagios::Objects
76
+
77
+ end # data files
78
+
79
+ end
@@ -0,0 +1,14 @@
1
+
2
+ TEST = if ENV['RSPEC_ENV'] == 'test'
3
+ {
4
+ :nagios_cfg => 'test/data/nagios.cfg',
5
+ :status_file => 'test/data/status.dat',
6
+ :object_cache_file => 'test/data/objects.cache',
7
+ }
8
+ else
9
+ {
10
+ :nagios_cfg => nil,
11
+ :status_file => nil,
12
+ :object_cache_file => nil
13
+ }
14
+ end
data/test/benchmark.rb ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env ruby
2
+ $: << (File.dirname(__FILE__) + "/../lib")
3
+
4
+ require 'benchmark'
5
+ require "ruby-nagios/nagios/status"
6
+ a = Nagios::Status.new "./data/status.dat"
7
+
8
+ p "Regular parse"
9
+
10
+ time = Benchmark.measure do
11
+ 1000.times { a.parse }
12
+ end
13
+
14
+ p time
15
+
16
+ require "nagira/status"
17
+ b = Nagios::Status.new "./data/status.dat"
18
+
19
+
20
+ p "Timed parse"
21
+
22
+ time = Benchmark.measure do
23
+ 1000.times { b.parse }
24
+ end
25
+
26
+ p time
@@ -0,0 +1 @@
1
+ Bad configuration files for Nagios - for testing
@@ -0,0 +1,1305 @@
1
+ ##############################################################################
2
+ #
3
+ # NAGIOS.CFG - Sample Main Config File for Nagios
4
+ #
5
+ #
6
+ ##############################################################################
7
+
8
+
9
+ # LOG FILE
10
+ # This is the main log file where service and host events are logged
11
+ # for historical purposes. This should be the first option specified
12
+ # in the config file!!!
13
+
14
+ log_file=/var/log/nagios3/nagios.log
15
+
16
+ # Commands definitions
17
+ cfg_file=/etc/nagios3/commands.cfg
18
+
19
+ # Debian also defaults to using the check commands defined by the debian
20
+ # nagios-plugins package
21
+ cfg_dir=/etc/nagios-plugins/config
22
+
23
+
24
+ # Debian uses by default a configuration directory where nagios3-common,
25
+ # other packages and the local admin can dump or link configuration
26
+ # files into.
27
+ cfg_dir=/etc/nagios3/conf.d
28
+
29
+ # OBJECT CONFIGURATION FILE(S)
30
+ # These are the object configuration files in which you define hosts,
31
+ # host groups, contacts, contact groups, services, etc.
32
+ # You can split your object definitions across several config files
33
+ # if you wish (as shown below), or keep them all in a single config file.
34
+
35
+ # You can specify individual object config files as shown below:
36
+ #cfg_file=/etc/nagios3/objects/commands.cfg
37
+ #cfg_file=/etc/nagios3/objects/contacts.cfg
38
+ #cfg_file=/etc/nagios3/objects/timeperiods.cfg
39
+ #cfg_file=/etc/nagios3/objects/templates.cfg
40
+
41
+ # Definitions for monitoring a Windows machine
42
+ #cfg_file=/etc/nagios3/objects/windows.cfg
43
+
44
+ # Definitions for monitoring a router/switch
45
+ #cfg_file=/etc/nagios3/objects/switch.cfg
46
+
47
+ # Definitions for monitoring a network printer
48
+ #cfg_file=/etc/nagios3/objects/printer.cfg
49
+
50
+
51
+ # You can also tell Nagios to process all config files (with a .cfg
52
+ # extension) in a particular directory by using the cfg_dir
53
+ # directive as shown below:
54
+
55
+ #cfg_dir=/etc/nagios3/servers
56
+ #cfg_dir=/etc/nagios3/printers
57
+ #cfg_dir=/etc/nagios3/switches
58
+ #cfg_dir=/etc/nagios3/routers
59
+
60
+
61
+
62
+
63
+
64
+ # OBJECT CACHE FILE
65
+ # This option determines where object definitions are cached when
66
+ # Nagios starts/restarts. The CGIs read object definitions from
67
+ # this cache file (rather than looking at the object config files
68
+ # directly) in order to prevent inconsistencies that can occur
69
+ # when the config files are modified after Nagios starts.
70
+
71
+ # object_cache_file=/var/cache/nagios3/objects.cache
72
+ object_cache_file=/Users/dmytro/Development/nagira/test/data/objects.cache
73
+
74
+
75
+
76
+ # PRE-CACHED OBJECT FILE
77
+ # This options determines the location of the precached object file.
78
+ # If you run Nagios with the -p command line option, it will preprocess
79
+ # your object configuration file(s) and write the cached config to this
80
+ # file. You can then start Nagios with the -u option to have it read
81
+ # object definitions from this precached file, rather than the standard
82
+ # object configuration files (see the cfg_file and cfg_dir options above).
83
+ # Using a precached object file can speed up the time needed to (re)start
84
+ # the Nagios process if you've got a large and/or complex configuration.
85
+ # Read the documentation section on optimizing Nagios to find our more
86
+ # about how this feature works.
87
+
88
+ precached_object_file=/var/lib/nagios3/objects.precache
89
+
90
+
91
+
92
+ # RESOURCE FILE
93
+ # This is an optional resource file that contains $USERx$ macro
94
+ # definitions. Multiple resource files can be specified by using
95
+ # multiple resource_file definitions. The CGIs will not attempt to
96
+ # read the contents of resource files, so information that is
97
+ # considered to be sensitive (usernames, passwords, etc) can be
98
+ # defined as macros in this file and restrictive permissions (600)
99
+ # can be placed on this file.
100
+
101
+ resource_file=/etc/nagios3/resource.cfg
102
+
103
+
104
+
105
+ # STATUS FILE
106
+ # This is where the current status of all monitored services and
107
+ # hosts is stored. Its contents are read and processed by the CGIs.
108
+ # The contents of the status file are deleted every time Nagios
109
+ # restarts.
110
+
111
+ # status_file=/var/cache/nagios3/status.dat
112
+ status_file=/Users/dmytro/Development/nagira/test/data/status.dat
113
+
114
+
115
+
116
+ # STATUS FILE UPDATE INTERVAL
117
+ # This option determines the frequency (in seconds) that
118
+ # Nagios will periodically dump program, host, and
119
+ # service status data.
120
+
121
+ status_update_interval=10
122
+
123
+
124
+
125
+ # NAGIOS USER
126
+ # This determines the effective user that Nagios should run as.
127
+ # You can either supply a username or a UID.
128
+
129
+ nagios_user=nagios
130
+
131
+
132
+
133
+ # NAGIOS GROUP
134
+ # This determines the effective group that Nagios should run as.
135
+ # You can either supply a group name or a GID.
136
+
137
+ nagios_group=nagios
138
+
139
+
140
+
141
+ # EXTERNAL COMMAND OPTION
142
+ # This option allows you to specify whether or not Nagios should check
143
+ # for external commands (in the command file defined below). By default
144
+ # Nagios will *not* check for external commands, just to be on the
145
+ # cautious side. If you want to be able to use the CGI command interface
146
+ # you will have to enable this.
147
+ # Values: 0 = disable commands, 1 = enable commands
148
+
149
+ check_external_commands=1
150
+
151
+
152
+
153
+ # EXTERNAL COMMAND CHECK INTERVAL
154
+ # This is the interval at which Nagios should check for external commands.
155
+ # This value works of the interval_length you specify later. If you leave
156
+ # that at its default value of 60 (seconds), a value of 1 here will cause
157
+ # Nagios to check for external commands every minute. If you specify a
158
+ # number followed by an "s" (i.e. 15s), this will be interpreted to mean
159
+ # actual seconds rather than a multiple of the interval_length variable.
160
+ # Note: In addition to reading the external command file at regularly
161
+ # scheduled intervals, Nagios will also check for external commands after
162
+ # event handlers are executed.
163
+ # NOTE: Setting this value to -1 causes Nagios to check the external
164
+ # command file as often as possible.
165
+
166
+ #command_check_interval=15s
167
+ command_check_interval=-1
168
+
169
+
170
+
171
+ # EXTERNAL COMMAND FILE
172
+ # This is the file that Nagios checks for external command requests.
173
+ # It is also where the command CGI will write commands that are submitted
174
+ # by users, so it must be writeable by the user that the web server
175
+ # is running as (usually 'nobody'). Permissions should be set at the
176
+ # directory level instead of on the file, as the file is deleted every
177
+ # time its contents are processed.
178
+ # Debian Users: In case you didn't read README.Debian yet, _NOW_ is the
179
+ # time to do it.
180
+
181
+ command_file=/var/lib/nagios3/rw/nagios.cmd
182
+
183
+
184
+
185
+ # EXTERNAL COMMAND BUFFER SLOTS
186
+ # This settings is used to tweak the number of items or "slots" that
187
+ # the Nagios daemon should allocate to the buffer that holds incoming
188
+ # external commands before they are processed. As external commands
189
+ # are processed by the daemon, they are removed from the buffer.
190
+
191
+ external_command_buffer_slots=4096
192
+
193
+
194
+
195
+ # LOCK FILE
196
+ # This is the lockfile that Nagios will use to store its PID number
197
+ # in when it is running in daemon mode.
198
+
199
+ lock_file=/var/run/nagios3/nagios3.pid
200
+
201
+
202
+
203
+ # TEMP FILE
204
+ # This is a temporary file that is used as scratch space when Nagios
205
+ # updates the status log, cleans the comment file, etc. This file
206
+ # is created, used, and deleted throughout the time that Nagios is
207
+ # running.
208
+
209
+ temp_file=/var/cache/nagios3/nagios.tmp
210
+
211
+
212
+
213
+ # TEMP PATH
214
+ # This is path where Nagios can create temp files for service and
215
+ # host check results, etc.
216
+
217
+ temp_path=/tmp
218
+
219
+
220
+
221
+ # EVENT BROKER OPTIONS
222
+ # Controls what (if any) data gets sent to the event broker.
223
+ # Values: 0 = Broker nothing
224
+ # -1 = Broker everything
225
+ # <other> = See documentation
226
+
227
+ event_broker_options=-1
228
+
229
+
230
+
231
+ # EVENT BROKER MODULE(S)
232
+ # This directive is used to specify an event broker module that should
233
+ # by loaded by Nagios at startup. Use multiple directives if you want
234
+ # to load more than one module. Arguments that should be passed to
235
+ # the module at startup are seperated from the module path by a space.
236
+ #
237
+ #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
238
+ # WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING
239
+ #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
240
+ #
241
+ # Do NOT overwrite modules while they are being used by Nagios or Nagios
242
+ # will crash in a fiery display of SEGFAULT glory. This is a bug/limitation
243
+ # either in dlopen(), the kernel, and/or the filesystem. And maybe Nagios...
244
+ #
245
+ # The correct/safe way of updating a module is by using one of these methods:
246
+ # 1. Shutdown Nagios, replace the module file, restart Nagios
247
+ # 2. Delete the original module file, move the new module file into place, restart Nagios
248
+ #
249
+ # Example:
250
+ #
251
+ # broker_module=<modulepath> [moduleargs]
252
+
253
+ #broker_module=/somewhere/module1.o
254
+ #broker_module=/somewhere/module2.o arg1 arg2=3 debug=0
255
+
256
+
257
+
258
+ # LOG ROTATION METHOD
259
+ # This is the log rotation method that Nagios should use to rotate
260
+ # the main log file. Values are as follows..
261
+ # n = None - don't rotate the log
262
+ # h = Hourly rotation (top of the hour)
263
+ # d = Daily rotation (midnight every day)
264
+ # w = Weekly rotation (midnight on Saturday evening)
265
+ # m = Monthly rotation (midnight last day of month)
266
+
267
+ log_rotation_method=d
268
+
269
+
270
+
271
+ # LOG ARCHIVE PATH
272
+ # This is the directory where archived (rotated) log files should be
273
+ # placed (assuming you've chosen to do log rotation).
274
+
275
+ log_archive_path=/var/log/nagios3/archives
276
+
277
+
278
+
279
+ # LOGGING OPTIONS
280
+ # If you want messages logged to the syslog facility, as well as the
281
+ # Nagios log file set this option to 1. If not, set it to 0.
282
+
283
+ use_syslog=1
284
+
285
+
286
+
287
+ # NOTIFICATION LOGGING OPTION
288
+ # If you don't want notifications to be logged, set this value to 0.
289
+ # If notifications should be logged, set the value to 1.
290
+
291
+ log_notifications=1
292
+
293
+
294
+
295
+ # SERVICE RETRY LOGGING OPTION
296
+ # If you don't want service check retries to be logged, set this value
297
+ # to 0. If retries should be logged, set the value to 1.
298
+
299
+ log_service_retries=1
300
+
301
+
302
+
303
+ # HOST RETRY LOGGING OPTION
304
+ # If you don't want host check retries to be logged, set this value to
305
+ # 0. If retries should be logged, set the value to 1.
306
+
307
+ log_host_retries=1
308
+
309
+
310
+
311
+ # EVENT HANDLER LOGGING OPTION
312
+ # If you don't want host and service event handlers to be logged, set
313
+ # this value to 0. If event handlers should be logged, set the value
314
+ # to 1.
315
+
316
+ log_event_handlers=1
317
+
318
+
319
+
320
+ # INITIAL STATES LOGGING OPTION
321
+ # If you want Nagios to log all initial host and service states to
322
+ # the main log file (the first time the service or host is checked)
323
+ # you can enable this option by setting this value to 1. If you
324
+ # are not using an external application that does long term state
325
+ # statistics reporting, you do not need to enable this option. In
326
+ # this case, set the value to 0.
327
+
328
+ log_initial_states=0
329
+
330
+
331
+
332
+ # EXTERNAL COMMANDS LOGGING OPTION
333
+ # If you don't want Nagios to log external commands, set this value
334
+ # to 0. If external commands should be logged, set this value to 1.
335
+ # Note: This option does not include logging of passive service
336
+ # checks - see the option below for controlling whether or not
337
+ # passive checks are logged.
338
+
339
+ log_external_commands=1
340
+
341
+
342
+
343
+ # PASSIVE CHECKS LOGGING OPTION
344
+ # If you don't want Nagios to log passive host and service checks, set
345
+ # this value to 0. If passive checks should be logged, set
346
+ # this value to 1.
347
+
348
+ log_passive_checks=1
349
+
350
+
351
+
352
+ # GLOBAL HOST AND SERVICE EVENT HANDLERS
353
+ # These options allow you to specify a host and service event handler
354
+ # command that is to be run for every host or service state change.
355
+ # The global event handler is executed immediately prior to the event
356
+ # handler that you have optionally specified in each host or
357
+ # service definition. The command argument is the short name of a
358
+ # command definition that you define in your host configuration file.
359
+ # Read the HTML docs for more information.
360
+
361
+ #global_host_event_handler=somecommand
362
+ #global_service_event_handler=somecommand
363
+
364
+
365
+
366
+ # SERVICE INTER-CHECK DELAY METHOD
367
+ # This is the method that Nagios should use when initially
368
+ # "spreading out" service checks when it starts monitoring. The
369
+ # default is to use smart delay calculation, which will try to
370
+ # space all service checks out evenly to minimize CPU load.
371
+ # Using the dumb setting will cause all checks to be scheduled
372
+ # at the same time (with no delay between them)! This is not a
373
+ # good thing for production, but is useful when testing the
374
+ # parallelization functionality.
375
+ # n = None - don't use any delay between checks
376
+ # d = Use a "dumb" delay of 1 second between checks
377
+ # s = Use "smart" inter-check delay calculation
378
+ # x.xx = Use an inter-check delay of x.xx seconds
379
+
380
+ service_inter_check_delay_method=s
381
+
382
+
383
+
384
+ # MAXIMUM SERVICE CHECK SPREAD
385
+ # This variable determines the timeframe (in minutes) from the
386
+ # program start time that an initial check of all services should
387
+ # be completed. Default is 30 minutes.
388
+
389
+ max_service_check_spread=30
390
+
391
+
392
+
393
+ # SERVICE CHECK INTERLEAVE FACTOR
394
+ # This variable determines how service checks are interleaved.
395
+ # Interleaving the service checks allows for a more even
396
+ # distribution of service checks and reduced load on remote
397
+ # hosts. Setting this value to 1 is equivalent to how versions
398
+ # of Nagios previous to 0.0.5 did service checks. Set this
399
+ # value to s (smart) for automatic calculation of the interleave
400
+ # factor unless you have a specific reason to change it.
401
+ # s = Use "smart" interleave factor calculation
402
+ # x = Use an interleave factor of x, where x is a
403
+ # number greater than or equal to 1.
404
+
405
+ service_interleave_factor=s
406
+
407
+
408
+
409
+ # HOST INTER-CHECK DELAY METHOD
410
+ # This is the method that Nagios should use when initially
411
+ # "spreading out" host checks when it starts monitoring. The
412
+ # default is to use smart delay calculation, which will try to
413
+ # space all host checks out evenly to minimize CPU load.
414
+ # Using the dumb setting will cause all checks to be scheduled
415
+ # at the same time (with no delay between them)!
416
+ # n = None - don't use any delay between checks
417
+ # d = Use a "dumb" delay of 1 second between checks
418
+ # s = Use "smart" inter-check delay calculation
419
+ # x.xx = Use an inter-check delay of x.xx seconds
420
+
421
+ host_inter_check_delay_method=s
422
+
423
+
424
+
425
+ # MAXIMUM HOST CHECK SPREAD
426
+ # This variable determines the timeframe (in minutes) from the
427
+ # program start time that an initial check of all hosts should
428
+ # be completed. Default is 30 minutes.
429
+
430
+ max_host_check_spread=30
431
+
432
+
433
+
434
+ # MAXIMUM CONCURRENT SERVICE CHECKS
435
+ # This option allows you to specify the maximum number of
436
+ # service checks that can be run in parallel at any given time.
437
+ # Specifying a value of 1 for this variable essentially prevents
438
+ # any service checks from being parallelized. A value of 0
439
+ # will not restrict the number of concurrent checks that are
440
+ # being executed.
441
+
442
+ max_concurrent_checks=0
443
+
444
+
445
+
446
+ # HOST AND SERVICE CHECK REAPER FREQUENCY
447
+ # This is the frequency (in seconds!) that Nagios will process
448
+ # the results of host and service checks.
449
+
450
+ check_result_reaper_frequency=10
451
+
452
+
453
+
454
+
455
+ # MAX CHECK RESULT REAPER TIME
456
+ # This is the max amount of time (in seconds) that a single
457
+ # check result reaper event will be allowed to run before
458
+ # returning control back to Nagios so it can perform other
459
+ # duties.
460
+
461
+ max_check_result_reaper_time=30
462
+
463
+
464
+
465
+
466
+ # CHECK RESULT PATH
467
+ # This is directory where Nagios stores the results of host and
468
+ # service checks that have not yet been processed.
469
+ #
470
+ # Note: Make sure that only one instance of Nagios has access
471
+ # to this directory!
472
+
473
+ check_result_path=/var/lib/nagios3/spool/checkresults
474
+
475
+
476
+
477
+
478
+ # MAX CHECK RESULT FILE AGE
479
+ # This option determines the maximum age (in seconds) which check
480
+ # result files are considered to be valid. Files older than this
481
+ # threshold will be mercilessly deleted without further processing.
482
+
483
+ max_check_result_file_age=3600
484
+
485
+
486
+
487
+
488
+ # CACHED HOST CHECK HORIZON
489
+ # This option determines the maximum amount of time (in seconds)
490
+ # that the state of a previous host check is considered current.
491
+ # Cached host states (from host checks that were performed more
492
+ # recently that the timeframe specified by this value) can immensely
493
+ # improve performance in regards to the host check logic.
494
+ # Too high of a value for this option may result in inaccurate host
495
+ # states being used by Nagios, while a lower value may result in a
496
+ # performance hit for host checks. Use a value of 0 to disable host
497
+ # check caching.
498
+
499
+ cached_host_check_horizon=15
500
+
501
+
502
+
503
+ # CACHED SERVICE CHECK HORIZON
504
+ # This option determines the maximum amount of time (in seconds)
505
+ # that the state of a previous service check is considered current.
506
+ # Cached service states (from service checks that were performed more
507
+ # recently that the timeframe specified by this value) can immensely
508
+ # improve performance in regards to predictive dependency checks.
509
+ # Use a value of 0 to disable service check caching.
510
+
511
+ cached_service_check_horizon=15
512
+
513
+
514
+
515
+ # ENABLE PREDICTIVE HOST DEPENDENCY CHECKS
516
+ # This option determines whether or not Nagios will attempt to execute
517
+ # checks of hosts when it predicts that future dependency logic test
518
+ # may be needed. These predictive checks can help ensure that your
519
+ # host dependency logic works well.
520
+ # Values:
521
+ # 0 = Disable predictive checks
522
+ # 1 = Enable predictive checks (default)
523
+
524
+ enable_predictive_host_dependency_checks=1
525
+
526
+
527
+
528
+ # ENABLE PREDICTIVE SERVICE DEPENDENCY CHECKS
529
+ # This option determines whether or not Nagios will attempt to execute
530
+ # checks of service when it predicts that future dependency logic test
531
+ # may be needed. These predictive checks can help ensure that your
532
+ # service dependency logic works well.
533
+ # Values:
534
+ # 0 = Disable predictive checks
535
+ # 1 = Enable predictive checks (default)
536
+
537
+ enable_predictive_service_dependency_checks=1
538
+
539
+
540
+
541
+ # SOFT STATE DEPENDENCIES
542
+ # This option determines whether or not Nagios will use soft state
543
+ # information when checking host and service dependencies. Normally
544
+ # Nagios will only use the latest hard host or service state when
545
+ # checking dependencies. If you want it to use the latest state (regardless
546
+ # of whether its a soft or hard state type), enable this option.
547
+ # Values:
548
+ # 0 = Don't use soft state dependencies (default)
549
+ # 1 = Use soft state dependencies
550
+
551
+ soft_state_dependencies=0
552
+
553
+
554
+
555
+ # TIME CHANGE ADJUSTMENT THRESHOLDS
556
+ # These options determine when Nagios will react to detected changes
557
+ # in system time (either forward or backwards).
558
+
559
+ #time_change_threshold=900
560
+
561
+
562
+
563
+ # AUTO-RESCHEDULING OPTION
564
+ # This option determines whether or not Nagios will attempt to
565
+ # automatically reschedule active host and service checks to
566
+ # "smooth" them out over time. This can help balance the load on
567
+ # the monitoring server.
568
+ # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
569
+ # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
570
+
571
+ auto_reschedule_checks=0
572
+
573
+
574
+
575
+ # AUTO-RESCHEDULING INTERVAL
576
+ # This option determines how often (in seconds) Nagios will
577
+ # attempt to automatically reschedule checks. This option only
578
+ # has an effect if the auto_reschedule_checks option is enabled.
579
+ # Default is 30 seconds.
580
+ # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
581
+ # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
582
+
583
+ auto_rescheduling_interval=30
584
+
585
+
586
+
587
+ # AUTO-RESCHEDULING WINDOW
588
+ # This option determines the "window" of time (in seconds) that
589
+ # Nagios will look at when automatically rescheduling checks.
590
+ # Only host and service checks that occur in the next X seconds
591
+ # (determined by this variable) will be rescheduled. This option
592
+ # only has an effect if the auto_reschedule_checks option is
593
+ # enabled. Default is 180 seconds (3 minutes).
594
+ # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
595
+ # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
596
+
597
+ auto_rescheduling_window=180
598
+
599
+
600
+
601
+ # SLEEP TIME
602
+ # This is the number of seconds to sleep between checking for system
603
+ # events and service checks that need to be run.
604
+
605
+ sleep_time=0.25
606
+
607
+
608
+
609
+ # TIMEOUT VALUES
610
+ # These options control how much time Nagios will allow various
611
+ # types of commands to execute before killing them off. Options
612
+ # are available for controlling maximum time allotted for
613
+ # service checks, host checks, event handlers, notifications, the
614
+ # ocsp command, and performance data commands. All values are in
615
+ # seconds.
616
+
617
+ service_check_timeout=60
618
+ host_check_timeout=30
619
+ event_handler_timeout=30
620
+ notification_timeout=30
621
+ ocsp_timeout=5
622
+ perfdata_timeout=5
623
+
624
+
625
+
626
+ # RETAIN STATE INFORMATION
627
+ # This setting determines whether or not Nagios will save state
628
+ # information for services and hosts before it shuts down. Upon
629
+ # startup Nagios will reload all saved service and host state
630
+ # information before starting to monitor. This is useful for
631
+ # maintaining long-term data on state statistics, etc, but will
632
+ # slow Nagios down a bit when it (re)starts. Since its only
633
+ # a one-time penalty, I think its well worth the additional
634
+ # startup delay.
635
+
636
+ retain_state_information=1
637
+
638
+
639
+
640
+ # STATE RETENTION FILE
641
+ # This is the file that Nagios should use to store host and
642
+ # service state information before it shuts down. The state
643
+ # information in this file is also read immediately prior to
644
+ # starting to monitor the network when Nagios is restarted.
645
+ # This file is used only if the preserve_state_information
646
+ # variable is set to 1.
647
+
648
+ state_retention_file=/var/lib/nagios3/retention.dat
649
+
650
+
651
+
652
+ # RETENTION DATA UPDATE INTERVAL
653
+ # This setting determines how often (in minutes) that Nagios
654
+ # will automatically save retention data during normal operation.
655
+ # If you set this value to 0, Nagios will not save retention
656
+ # data at regular interval, but it will still save retention
657
+ # data before shutting down or restarting. If you have disabled
658
+ # state retention, this option has no effect.
659
+
660
+ retention_update_interval=60
661
+
662
+
663
+
664
+ # USE RETAINED PROGRAM STATE
665
+ # This setting determines whether or not Nagios will set
666
+ # program status variables based on the values saved in the
667
+ # retention file. If you want to use retained program status
668
+ # information, set this value to 1. If not, set this value
669
+ # to 0.
670
+
671
+ use_retained_program_state=1
672
+
673
+
674
+
675
+ # USE RETAINED SCHEDULING INFO
676
+ # This setting determines whether or not Nagios will retain
677
+ # the scheduling info (next check time) for hosts and services
678
+ # based on the values saved in the retention file. If you
679
+ # If you want to use retained scheduling info, set this
680
+ # value to 1. If not, set this value to 0.
681
+
682
+ use_retained_scheduling_info=1
683
+
684
+
685
+
686
+ # RETAINED ATTRIBUTE MASKS (ADVANCED FEATURE)
687
+ # The following variables are used to specify specific host and
688
+ # service attributes that should *not* be retained by Nagios during
689
+ # program restarts.
690
+ #
691
+ # The values of the masks are bitwise ANDs of values specified
692
+ # by the "MODATTR_" definitions found in include/common.h.
693
+ # For example, if you do not want the current enabled/disabled state
694
+ # of flap detection and event handlers for hosts to be retained, you
695
+ # would use a value of 24 for the host attribute mask...
696
+ # MODATTR_EVENT_HANDLER_ENABLED (8) + MODATTR_FLAP_DETECTION_ENABLED (16) = 24
697
+
698
+ # This mask determines what host attributes are not retained
699
+ retained_host_attribute_mask=0
700
+
701
+ # This mask determines what service attributes are not retained
702
+ retained_service_attribute_mask=0
703
+
704
+ # These two masks determine what process attributes are not retained.
705
+ # There are two masks, because some process attributes have host and service
706
+ # options. For example, you can disable active host checks, but leave active
707
+ # service checks enabled.
708
+ retained_process_host_attribute_mask=0
709
+ retained_process_service_attribute_mask=0
710
+
711
+ # These two masks determine what contact attributes are not retained.
712
+ # There are two masks, because some contact attributes have host and
713
+ # service options. For example, you can disable host notifications for
714
+ # a contact, but leave service notifications enabled for them.
715
+ retained_contact_host_attribute_mask=0
716
+ retained_contact_service_attribute_mask=0
717
+
718
+
719
+
720
+ # INTERVAL LENGTH
721
+ # This is the seconds per unit interval as used in the
722
+ # host/contact/service configuration files. Setting this to 60 means
723
+ # that each interval is one minute long (60 seconds). Other settings
724
+ # have not been tested much, so your mileage is likely to vary...
725
+
726
+ interval_length=60
727
+
728
+
729
+
730
+ # AGGRESSIVE HOST CHECKING OPTION
731
+ # If you don't want to turn on aggressive host checking features, set
732
+ # this value to 0 (the default). Otherwise set this value to 1 to
733
+ # enable the aggressive check option. Read the docs for more info
734
+ # on what aggressive host check is or check out the source code in
735
+ # base/checks.c
736
+
737
+ use_aggressive_host_checking=0
738
+
739
+
740
+
741
+ # SERVICE CHECK EXECUTION OPTION
742
+ # This determines whether or not Nagios will actively execute
743
+ # service checks when it initially starts. If this option is
744
+ # disabled, checks are not actively made, but Nagios can still
745
+ # receive and process passive check results that come in. Unless
746
+ # you're implementing redundant hosts or have a special need for
747
+ # disabling the execution of service checks, leave this enabled!
748
+ # Values: 1 = enable checks, 0 = disable checks
749
+
750
+ execute_service_checks=1
751
+
752
+
753
+
754
+ # PASSIVE SERVICE CHECK ACCEPTANCE OPTION
755
+ # This determines whether or not Nagios will accept passive
756
+ # service checks results when it initially (re)starts.
757
+ # Values: 1 = accept passive checks, 0 = reject passive checks
758
+
759
+ accept_passive_service_checks=1
760
+
761
+
762
+
763
+ # HOST CHECK EXECUTION OPTION
764
+ # This determines whether or not Nagios will actively execute
765
+ # host checks when it initially starts. If this option is
766
+ # disabled, checks are not actively made, but Nagios can still
767
+ # receive and process passive check results that come in. Unless
768
+ # you're implementing redundant hosts or have a special need for
769
+ # disabling the execution of host checks, leave this enabled!
770
+ # Values: 1 = enable checks, 0 = disable checks
771
+
772
+ execute_host_checks=1
773
+
774
+
775
+
776
+ # PASSIVE HOST CHECK ACCEPTANCE OPTION
777
+ # This determines whether or not Nagios will accept passive
778
+ # host checks results when it initially (re)starts.
779
+ # Values: 1 = accept passive checks, 0 = reject passive checks
780
+
781
+ accept_passive_host_checks=1
782
+
783
+
784
+
785
+ # NOTIFICATIONS OPTION
786
+ # This determines whether or not Nagios will sent out any host or
787
+ # service notifications when it is initially (re)started.
788
+ # Values: 1 = enable notifications, 0 = disable notifications
789
+
790
+ enable_notifications=1
791
+
792
+
793
+
794
+ # EVENT HANDLER USE OPTION
795
+ # This determines whether or not Nagios will run any host or
796
+ # service event handlers when it is initially (re)started. Unless
797
+ # you're implementing redundant hosts, leave this option enabled.
798
+ # Values: 1 = enable event handlers, 0 = disable event handlers
799
+
800
+ enable_event_handlers=1
801
+
802
+
803
+
804
+ # PROCESS PERFORMANCE DATA OPTION
805
+ # This determines whether or not Nagios will process performance
806
+ # data returned from service and host checks. If this option is
807
+ # enabled, host performance data will be processed using the
808
+ # host_perfdata_command (defined below) and service performance
809
+ # data will be processed using the service_perfdata_command (also
810
+ # defined below). Read the HTML docs for more information on
811
+ # performance data.
812
+ # Values: 1 = process performance data, 0 = do not process performance data
813
+
814
+ process_performance_data=0
815
+
816
+
817
+
818
+ # HOST AND SERVICE PERFORMANCE DATA PROCESSING COMMANDS
819
+ # These commands are run after every host and service check is
820
+ # performed. These commands are executed only if the
821
+ # enable_performance_data option (above) is set to 1. The command
822
+ # argument is the short name of a command definition that you
823
+ # define in your host configuration file. Read the HTML docs for
824
+ # more information on performance data.
825
+
826
+ #host_perfdata_command=process-host-perfdata
827
+ #service_perfdata_command=process-service-perfdata
828
+
829
+
830
+
831
+ # HOST AND SERVICE PERFORMANCE DATA FILES
832
+ # These files are used to store host and service performance data.
833
+ # Performance data is only written to these files if the
834
+ # enable_performance_data option (above) is set to 1.
835
+
836
+ #host_perfdata_file=/tmp/host-perfdata
837
+ #service_perfdata_file=/tmp/service-perfdata
838
+
839
+
840
+
841
+ # HOST AND SERVICE PERFORMANCE DATA FILE TEMPLATES
842
+ # These options determine what data is written (and how) to the
843
+ # performance data files. The templates may contain macros, special
844
+ # characters (\t for tab, \r for carriage return, \n for newline)
845
+ # and plain text. A newline is automatically added after each write
846
+ # to the performance data file. Some examples of what you can do are
847
+ # shown below.
848
+
849
+ #host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
850
+ #service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
851
+
852
+
853
+
854
+ # HOST AND SERVICE PERFORMANCE DATA FILE MODES
855
+ # This option determines whether or not the host and service
856
+ # performance data files are opened in write ("w") or append ("a")
857
+ # mode. If you want to use named pipes, you should use the special
858
+ # pipe ("p") mode which avoid blocking at startup, otherwise you will
859
+ # likely want the defult append ("a") mode.
860
+
861
+ #host_perfdata_file_mode=a
862
+ #service_perfdata_file_mode=a
863
+
864
+
865
+
866
+ # HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING INTERVAL
867
+ # These options determine how often (in seconds) the host and service
868
+ # performance data files are processed using the commands defined
869
+ # below. A value of 0 indicates the files should not be periodically
870
+ # processed.
871
+
872
+ #host_perfdata_file_processing_interval=0
873
+ #service_perfdata_file_processing_interval=0
874
+
875
+
876
+
877
+ # HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING COMMANDS
878
+ # These commands are used to periodically process the host and
879
+ # service performance data files. The interval at which the
880
+ # processing occurs is determined by the options above.
881
+
882
+ #host_perfdata_file_processing_command=process-host-perfdata-file
883
+ #service_perfdata_file_processing_command=process-service-perfdata-file
884
+
885
+
886
+
887
+ # OBSESS OVER SERVICE CHECKS OPTION
888
+ # This determines whether or not Nagios will obsess over service
889
+ # checks and run the ocsp_command defined below. Unless you're
890
+ # planning on implementing distributed monitoring, do not enable
891
+ # this option. Read the HTML docs for more information on
892
+ # implementing distributed monitoring.
893
+ # Values: 1 = obsess over services, 0 = do not obsess (default)
894
+
895
+ obsess_over_services=0
896
+
897
+
898
+
899
+ # OBSESSIVE COMPULSIVE SERVICE PROCESSOR COMMAND
900
+ # This is the command that is run for every service check that is
901
+ # processed by Nagios. This command is executed only if the
902
+ # obsess_over_services option (above) is set to 1. The command
903
+ # argument is the short name of a command definition that you
904
+ # define in your host configuration file. Read the HTML docs for
905
+ # more information on implementing distributed monitoring.
906
+
907
+ #ocsp_command=somecommand
908
+
909
+
910
+
911
+ # OBSESS OVER HOST CHECKS OPTION
912
+ # This determines whether or not Nagios will obsess over host
913
+ # checks and run the ochp_command defined below. Unless you're
914
+ # planning on implementing distributed monitoring, do not enable
915
+ # this option. Read the HTML docs for more information on
916
+ # implementing distributed monitoring.
917
+ # Values: 1 = obsess over hosts, 0 = do not obsess (default)
918
+
919
+ obsess_over_hosts=0
920
+
921
+
922
+
923
+ # OBSESSIVE COMPULSIVE HOST PROCESSOR COMMAND
924
+ # This is the command that is run for every host check that is
925
+ # processed by Nagios. This command is executed only if the
926
+ # obsess_over_hosts option (above) is set to 1. The command
927
+ # argument is the short name of a command definition that you
928
+ # define in your host configuration file. Read the HTML docs for
929
+ # more information on implementing distributed monitoring.
930
+
931
+ #ochp_command=somecommand
932
+
933
+
934
+
935
+ # TRANSLATE PASSIVE HOST CHECKS OPTION
936
+ # This determines whether or not Nagios will translate
937
+ # DOWN/UNREACHABLE passive host check results into their proper
938
+ # state for this instance of Nagios. This option is useful
939
+ # if you have distributed or failover monitoring setup. In
940
+ # these cases your other Nagios servers probably have a different
941
+ # "view" of the network, with regards to the parent/child relationship
942
+ # of hosts. If a distributed monitoring server thinks a host
943
+ # is DOWN, it may actually be UNREACHABLE from the point of
944
+ # this Nagios instance. Enabling this option will tell Nagios
945
+ # to translate any DOWN or UNREACHABLE host states it receives
946
+ # passively into the correct state from the view of this server.
947
+ # Values: 1 = perform translation, 0 = do not translate (default)
948
+
949
+ translate_passive_host_checks=0
950
+
951
+
952
+
953
+ # PASSIVE HOST CHECKS ARE SOFT OPTION
954
+ # This determines whether or not Nagios will treat passive host
955
+ # checks as being HARD or SOFT. By default, a passive host check
956
+ # result will put a host into a HARD state type. This can be changed
957
+ # by enabling this option.
958
+ # Values: 0 = passive checks are HARD, 1 = passive checks are SOFT
959
+
960
+ passive_host_checks_are_soft=0
961
+
962
+
963
+
964
+ # ORPHANED HOST/SERVICE CHECK OPTIONS
965
+ # These options determine whether or not Nagios will periodically
966
+ # check for orphaned host service checks. Since service checks are
967
+ # not rescheduled until the results of their previous execution
968
+ # instance are processed, there exists a possibility that some
969
+ # checks may never get rescheduled. A similar situation exists for
970
+ # host checks, although the exact scheduling details differ a bit
971
+ # from service checks. Orphaned checks seem to be a rare
972
+ # problem and should not happen under normal circumstances.
973
+ # If you have problems with service checks never getting
974
+ # rescheduled, make sure you have orphaned service checks enabled.
975
+ # Values: 1 = enable checks, 0 = disable checks
976
+
977
+ check_for_orphaned_services=1
978
+ check_for_orphaned_hosts=1
979
+
980
+
981
+
982
+ # SERVICE FRESHNESS CHECK OPTION
983
+ # This option determines whether or not Nagios will periodically
984
+ # check the "freshness" of service results. Enabling this option
985
+ # is useful for ensuring passive checks are received in a timely
986
+ # manner.
987
+ # Values: 1 = enabled freshness checking, 0 = disable freshness checking
988
+
989
+ check_service_freshness=1
990
+
991
+
992
+
993
+ # SERVICE FRESHNESS CHECK INTERVAL
994
+ # This setting determines how often (in seconds) Nagios will
995
+ # check the "freshness" of service check results. If you have
996
+ # disabled service freshness checking, this option has no effect.
997
+
998
+ service_freshness_check_interval=60
999
+
1000
+
1001
+
1002
+ # HOST FRESHNESS CHECK OPTION
1003
+ # This option determines whether or not Nagios will periodically
1004
+ # check the "freshness" of host results. Enabling this option
1005
+ # is useful for ensuring passive checks are received in a timely
1006
+ # manner.
1007
+ # Values: 1 = enabled freshness checking, 0 = disable freshness checking
1008
+
1009
+ check_host_freshness=0
1010
+
1011
+
1012
+
1013
+ # HOST FRESHNESS CHECK INTERVAL
1014
+ # This setting determines how often (in seconds) Nagios will
1015
+ # check the "freshness" of host check results. If you have
1016
+ # disabled host freshness checking, this option has no effect.
1017
+
1018
+ host_freshness_check_interval=60
1019
+
1020
+
1021
+
1022
+
1023
+ # ADDITIONAL FRESHNESS THRESHOLD LATENCY
1024
+ # This setting determines the number of seconds that Nagios
1025
+ # will add to any host and service freshness thresholds that
1026
+ # it calculates (those not explicitly specified by the user).
1027
+
1028
+ additional_freshness_latency=15
1029
+
1030
+
1031
+
1032
+
1033
+ # FLAP DETECTION OPTION
1034
+ # This option determines whether or not Nagios will try
1035
+ # and detect hosts and services that are "flapping".
1036
+ # Flapping occurs when a host or service changes between
1037
+ # states too frequently. When Nagios detects that a
1038
+ # host or service is flapping, it will temporarily suppress
1039
+ # notifications for that host/service until it stops
1040
+ # flapping. Flap detection is very experimental, so read
1041
+ # the HTML documentation before enabling this feature!
1042
+ # Values: 1 = enable flap detection
1043
+ # 0 = disable flap detection (default)
1044
+
1045
+ enable_flap_detection=1
1046
+
1047
+
1048
+
1049
+ # FLAP DETECTION THRESHOLDS FOR HOSTS AND SERVICES
1050
+ # Read the HTML documentation on flap detection for
1051
+ # an explanation of what this option does. This option
1052
+ # has no effect if flap detection is disabled.
1053
+
1054
+ low_service_flap_threshold=5.0
1055
+ high_service_flap_threshold=20.0
1056
+ low_host_flap_threshold=5.0
1057
+ high_host_flap_threshold=20.0
1058
+
1059
+
1060
+
1061
+ # DATE FORMAT OPTION
1062
+ # This option determines how short dates are displayed. Valid options
1063
+ # include:
1064
+ # us (MM-DD-YYYY HH:MM:SS)
1065
+ # euro (DD-MM-YYYY HH:MM:SS)
1066
+ # iso8601 (YYYY-MM-DD HH:MM:SS)
1067
+ # strict-iso8601 (YYYY-MM-DDTHH:MM:SS)
1068
+ #
1069
+
1070
+ date_format=iso8601
1071
+
1072
+
1073
+
1074
+
1075
+ # TIMEZONE OFFSET
1076
+ # This option is used to override the default timezone that this
1077
+ # instance of Nagios runs in. If not specified, Nagios will use
1078
+ # the system configured timezone.
1079
+ #
1080
+ # NOTE: In order to display the correct timezone in the CGIs, you
1081
+ # will also need to alter the Apache directives for the CGI path
1082
+ # to include your timezone. Example:
1083
+ #
1084
+ # <Directory "/usr/local/nagios/sbin/">
1085
+ # SetEnv TZ "Australia/Brisbane"
1086
+ # ...
1087
+ # </Directory>
1088
+
1089
+ #use_timezone=US/Mountain
1090
+ #use_timezone=Australia/Brisbane
1091
+
1092
+
1093
+
1094
+
1095
+ # P1.PL FILE LOCATION
1096
+ # This value determines where the p1.pl perl script (used by the
1097
+ # embedded Perl interpreter) is located. If you didn't compile
1098
+ # Nagios with embedded Perl support, this option has no effect.
1099
+
1100
+ p1_file=/usr/lib/nagios3/p1.pl
1101
+
1102
+
1103
+
1104
+ # EMBEDDED PERL INTERPRETER OPTION
1105
+ # This option determines whether or not the embedded Perl interpreter
1106
+ # will be enabled during runtime. This option has no effect if Nagios
1107
+ # has not been compiled with support for embedded Perl.
1108
+ # Values: 0 = disable interpreter, 1 = enable interpreter
1109
+
1110
+ enable_embedded_perl=1
1111
+
1112
+
1113
+
1114
+ # EMBEDDED PERL USAGE OPTION
1115
+ # This option determines whether or not Nagios will process Perl plugins
1116
+ # and scripts with the embedded Perl interpreter if the plugins/scripts
1117
+ # do not explicitly indicate whether or not it is okay to do so. Read
1118
+ # the HTML documentation on the embedded Perl interpreter for more
1119
+ # information on how this option works.
1120
+
1121
+ use_embedded_perl_implicitly=1
1122
+
1123
+
1124
+
1125
+ # ILLEGAL OBJECT NAME CHARACTERS
1126
+ # This option allows you to specify illegal characters that cannot
1127
+ # be used in host names, service descriptions, or names of other
1128
+ # object types.
1129
+
1130
+ illegal_object_name_chars=`~!$%^&*|'"<>?,()=
1131
+
1132
+
1133
+
1134
+ # ILLEGAL MACRO OUTPUT CHARACTERS
1135
+ # This option allows you to specify illegal characters that are
1136
+ # stripped from macros before being used in notifications, event
1137
+ # handlers, etc. This DOES NOT affect macros used in service or
1138
+ # host check commands.
1139
+ # The following macros are stripped of the characters you specify:
1140
+ # $HOSTOUTPUT$
1141
+ # $HOSTPERFDATA$
1142
+ # $HOSTACKAUTHOR$
1143
+ # $HOSTACKCOMMENT$
1144
+ # $SERVICEOUTPUT$
1145
+ # $SERVICEPERFDATA$
1146
+ # $SERVICEACKAUTHOR$
1147
+ # $SERVICEACKCOMMENT$
1148
+
1149
+ illegal_macro_output_chars=`~$&|'"<>
1150
+
1151
+
1152
+
1153
+ # REGULAR EXPRESSION MATCHING
1154
+ # This option controls whether or not regular expression matching
1155
+ # takes place in the object config files. Regular expression
1156
+ # matching is used to match host, hostgroup, service, and service
1157
+ # group names/descriptions in some fields of various object types.
1158
+ # Values: 1 = enable regexp matching, 0 = disable regexp matching
1159
+
1160
+ use_regexp_matching=0
1161
+
1162
+
1163
+
1164
+ # "TRUE" REGULAR EXPRESSION MATCHING
1165
+ # This option controls whether or not "true" regular expression
1166
+ # matching takes place in the object config files. This option
1167
+ # only has an effect if regular expression matching is enabled
1168
+ # (see above). If this option is DISABLED, regular expression
1169
+ # matching only occurs if a string contains wildcard characters
1170
+ # (* and ?). If the option is ENABLED, regexp matching occurs
1171
+ # all the time (which can be annoying).
1172
+ # Values: 1 = enable true matching, 0 = disable true matching
1173
+
1174
+ use_true_regexp_matching=0
1175
+
1176
+
1177
+
1178
+ # ADMINISTRATOR EMAIL/PAGER ADDRESSES
1179
+ # The email and pager address of a global administrator (likely you).
1180
+ # Nagios never uses these values itself, but you can access them by
1181
+ # using the $ADMINEMAIL$ and $ADMINPAGER$ macros in your notification
1182
+ # commands.
1183
+
1184
+ admin_email=root@localhost
1185
+ admin_pager=pageroot@localhost
1186
+
1187
+
1188
+
1189
+ # DAEMON CORE DUMP OPTION
1190
+ # This option determines whether or not Nagios is allowed to create
1191
+ # a core dump when it runs as a daemon. Note that it is generally
1192
+ # considered bad form to allow this, but it may be useful for
1193
+ # debugging purposes. Enabling this option doesn't guarantee that
1194
+ # a core file will be produced, but that's just life...
1195
+ # Values: 1 - Allow core dumps
1196
+ # 0 - Do not allow core dumps (default)
1197
+
1198
+ daemon_dumps_core=0
1199
+
1200
+
1201
+
1202
+ # LARGE INSTALLATION TWEAKS OPTION
1203
+ # This option determines whether or not Nagios will take some shortcuts
1204
+ # which can save on memory and CPU usage in large Nagios installations.
1205
+ # Read the documentation for more information on the benefits/tradeoffs
1206
+ # of enabling this option.
1207
+ # Values: 1 - Enabled tweaks
1208
+ # 0 - Disable tweaks (default)
1209
+
1210
+ use_large_installation_tweaks=0
1211
+
1212
+
1213
+
1214
+ # ENABLE ENVIRONMENT MACROS
1215
+ # This option determines whether or not Nagios will make all standard
1216
+ # macros available as environment variables when host/service checks
1217
+ # and system commands (event handlers, notifications, etc.) are
1218
+ # executed. Enabling this option can cause performance issues in
1219
+ # large installations, as it will consume a bit more memory and (more
1220
+ # importantly) consume more CPU.
1221
+ # Values: 1 - Enable environment variable macros (default)
1222
+ # 0 - Disable environment variable macros
1223
+
1224
+ enable_environment_macros=1
1225
+
1226
+
1227
+
1228
+ # CHILD PROCESS MEMORY OPTION
1229
+ # This option determines whether or not Nagios will free memory in
1230
+ # child processes (processed used to execute system commands and host/
1231
+ # service checks). If you specify a value here, it will override
1232
+ # program defaults.
1233
+ # Value: 1 - Free memory in child processes
1234
+ # 0 - Do not free memory in child processes
1235
+
1236
+ #free_child_process_memory=1
1237
+
1238
+
1239
+
1240
+ # CHILD PROCESS FORKING BEHAVIOR
1241
+ # This option determines how Nagios will fork child processes
1242
+ # (used to execute system commands and host/service checks). Normally
1243
+ # child processes are fork()ed twice, which provides a very high level
1244
+ # of isolation from problems. Fork()ing once is probably enough and will
1245
+ # save a great deal on CPU usage (in large installs), so you might
1246
+ # want to consider using this. If you specify a value here, it will
1247
+ # program defaults.
1248
+ # Value: 1 - Child processes fork() twice
1249
+ # 0 - Child processes fork() just once
1250
+
1251
+ #child_processes_fork_twice=1
1252
+
1253
+
1254
+
1255
+ # DEBUG LEVEL
1256
+ # This option determines how much (if any) debugging information will
1257
+ # be written to the debug file. OR values together to log multiple
1258
+ # types of information.
1259
+ # Values:
1260
+ # -1 = Everything
1261
+ # 0 = Nothing
1262
+ # 1 = Functions
1263
+ # 2 = Configuration
1264
+ # 4 = Process information
1265
+ # 8 = Scheduled events
1266
+ # 16 = Host/service checks
1267
+ # 32 = Notifications
1268
+ # 64 = Event broker
1269
+ # 128 = External commands
1270
+ # 256 = Commands
1271
+ # 512 = Scheduled downtime
1272
+ # 1024 = Comments
1273
+ # 2048 = Macros
1274
+
1275
+ debug_level=0
1276
+
1277
+
1278
+
1279
+ # DEBUG VERBOSITY
1280
+ # This option determines how verbose the debug log out will be.
1281
+ # Values: 0 = Brief output
1282
+ # 1 = More detailed
1283
+ # 2 = Very detailed
1284
+
1285
+ debug_verbosity=1
1286
+
1287
+
1288
+
1289
+ # DEBUG FILE
1290
+ # This option determines where Nagios should write debugging information.
1291
+
1292
+ debug_file=/var/lib/nagios3/nagios.debug
1293
+
1294
+
1295
+
1296
+ # MAX DEBUG FILE SIZE
1297
+ # This option determines the maximum size (in bytes) of the debug file. If
1298
+ # the file grows larger than this size, it will be renamed with a .old
1299
+ # extension. If a file already exists with a .old extension it will
1300
+ # automatically be deleted. This helps ensure your disk space usage doesn't
1301
+ # get out of control when debugging Nagios.
1302
+
1303
+ max_debug_file_size=1000000
1304
+
1305
+