Codebase list libnagios-object-perl / a6af624
Import upstream version 0.21.20+git20210126.1.c8ee833 Debian Janitor 1 year, 4 months ago
57 changed file(s) with 7257 addition(s) and 119 deletion(s). Raw diff Collapse all Expand all
88 bugtracker =>
99 'https://rt.cpan.org/Public/Dist/Display.html?Name=Nagios-Object',
1010 homepage => 'http://github.com/duncs/perl-nagios-object',
11 ci => 'https://travis-ci.org/duncs/perl-nagios-object',
12 coverage =>
13 'https://coveralls.io/github/duncs/perl-nagios-object',
1114 },
1215 },
1316
1010 0.06 - Big reorganization of Nagios/Object.pm which should help towards making
1111 extending and overloading easier.
1212 - !!!!!!!!!! new() now require named arguments !!!!!!!!!!!!
13 - added prelimary Nagios 2.0 support - this is mostly untested
13 - added prelimary Nagios 2.0 support - this is mostly untested
1414 *** please send me <tobert@gmail.com> tests ***
1515 - started putting in support for a "fast mode" to skip parts of
1616 object resolution and registration for speed
109109 0.21.10 - Fixed test failure on Perl 5.11 (RT #54464)
110110 0.21.11 - Added repository, bugtracker and homepage resources
111111 0.21.12 - Fixed continuation line handling - Thanks to payerle (RT#58906)
112 0.21.13 - Fixed parsing of ServiceEscalation, ServiceDependency and HostEscalation types. Thanks to PIRZYK (RT#63802)
112 0.21.13 - Fixed parsing of ServiceEscalation, ServiceDependency and HostEscalation types. Thanks to PIRZYK (RT#63802)
113113 - Fixed host_name and hostgroup_name methods in various objects. Thanks to PIRZYK (RT#63805)
114114 - Improve find_object performance. Thanks to PIRZYK (RT#63803)
115115 - Allow for nested group membership. Thanks to PIRZYK (RT#63804)
99 lib/Nagios/Object.pm
1010 lib/Nagios/Object/Config.pm
1111 lib/Nagios/StatusLog.pm
12 lib/Nagios/Template.pm
1213 MANIFEST
1314 MANIFEST.SKIP
1415 META.yml
2526 t/60flexible-attributes2.cfg
2627 t/70status.dat
2728 t/70status.t
29 t/74status.dat
30 t/74status.t
2831 t/98nagios-sample-config.t
2932 t/99config-extend.t
3033 t/continuation_lines.t
4245 t/nagios.cfg
4346 t/nagios2config.t
4447 t/nagios3config.t
48 t/nagios4config.t
4549 t/nestedtemplates.cfg
4650 t/nestedtemplates.t
51 t/multipletemplates.cfg
52 t/multipletemplates.t
4753 t/sample-config-bigger.cfg
4854 t/sample-config-minimal.cfg
4955 t/sample-config-v3.cfg
102108 t/v3_config/template-object/timeperiods.cfg.in
103109 t/v3_config/template-object/windows.cfg
104110 t/v3_config/template-object/windows.cfg.in
111 t/v4_config/cgi.cfg
112 t/v4_config/cgi.cfg.in
113 t/v4_config/httpd.conf
114 t/v4_config/httpd.conf.in
115 t/v4_config/mrtg.cfg
116 t/v4_config/mrtg.cfg.in
117 t/v4_config/nagios.cfg
118 t/v4_config/nagios.cfg.in
119 t/v4_config/README
120 t/v4_config/resource.cfg
121 t/v4_config/resource.cfg.in
122 t/v4_config/template-object/commands.cfg
123 t/v4_config/template-object/commands.cfg.in
124 t/v4_config/template-object/contacts.cfg
125 t/v4_config/template-object/contacts.cfg.in
126 t/v4_config/template-object/localhost.cfg
127 t/v4_config/template-object/localhost.cfg.in
128 t/v4_config/template-object/printer.cfg
129 t/v4_config/template-object/printer.cfg.in
130 t/v4_config/template-object/README
131 t/v4_config/template-object/switch.cfg
132 t/v4_config/template-object/switch.cfg.in
133 t/v4_config/template-object/templates.cfg
134 t/v4_config/template-object/templates.cfg.in
135 t/v4_config/template-object/timeperiods.cfg
136 t/v4_config/template-object/timeperiods.cfg.in
137 t/v4_config/template-object/windows.cfg
138 t/v4_config/template-object/windows.cfg.in
105139 META.json
33 "Duncan Ferguson <duncs@cpan.org>"
44 ],
55 "dynamic_config" : 1,
6 "generated_by" : "Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921",
6 "generated_by" : "Module::Build version 0.4231",
77 "license" : [
8 "open_source"
8 "gpl_1"
99 ],
1010 "meta-spec" : {
1111 "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
12 "version" : "2"
12 "version" : 2
1313 },
1414 "name" : "Nagios-Object",
1515 "prereqs" : {
2626 },
2727 "configure" : {
2828 "requires" : {
29 "Module::Build" : "0.40"
29 "Module::Build" : "0.42"
3030 }
3131 },
3232 "runtime" : {
4545 "version" : "35"
4646 },
4747 "Nagios::Host" : {
48 "file" : "lib/Nagios/Object.pm",
49 "version" : 0
48 "file" : "lib/Nagios/Object.pm"
5049 },
5150 "Nagios::Host::Status" : {
5251 "file" : "lib/Nagios/StatusLog.pm",
5352 "version" : "0.1"
5453 },
5554 "Nagios::HostGroup" : {
56 "file" : "lib/Nagios/Object.pm",
57 "version" : 0
55 "file" : "lib/Nagios/Object.pm"
5856 },
5957 "Nagios::Info::Status" : {
6058 "file" : "lib/Nagios/StatusLog.pm",
7371 "version" : "0.1"
7472 },
7573 "Nagios::Service" : {
76 "file" : "lib/Nagios/Object.pm",
77 "version" : 0
74 "file" : "lib/Nagios/Object.pm"
7875 },
7976 "Nagios::Service::Status" : {
8077 "file" : "lib/Nagios/StatusLog.pm",
8178 "version" : "0.1"
8279 },
8380 "Nagios::ServiceGroup" : {
84 "file" : "lib/Nagios/Object.pm",
85 "version" : 0
81 "file" : "lib/Nagios/Object.pm"
8682 },
8783 "Nagios::StatusLog" : {
8884 "file" : "lib/Nagios/StatusLog.pm",
8985 "version" : "45"
86 },
87 "Nagios::Template" : {
88 "file" : "lib/Nagios/Template.pm"
9089 }
9190 },
9291 "release_status" : "stable",
10099 ],
101100 "repository" : {
102101 "url" : "http://github.com/duncs/perl-nagios-object"
103 }
102 },
103 "x_ci" : "https://travis-ci.org/duncs/perl-nagios-object",
104 "x_coverage" : "https://coveralls.io/github/duncs/perl-nagios-object"
104105 },
105 "version" : "v0.21.20"
106 "version" : "v0.21.20",
107 "x_serialization_backend" : "JSON::PP version 4.07"
106108 }
22 author:
33 - 'Duncan Ferguson <duncs@cpan.org>'
44 build_requires:
5 Data::Dumper: 0.01
6 List::Compare: 0.37
7 Module::Build: 0.26
8 Scalar::Util: 0.01
9 Test::Exception: 0.01
10 Test::More: 0.01
11 Test::NoWarnings: 0.08
5 Data::Dumper: '0.01'
6 List::Compare: '0.37'
7 Module::Build: '0.26'
8 Scalar::Util: '0.01'
9 Test::Exception: '0.01'
10 Test::More: '0.01'
11 Test::NoWarnings: '0.08'
1212 configure_requires:
13 Module::Build: 0.40
13 Module::Build: '0.42'
1414 dynamic_config: 1
15 generated_by: 'Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921'
16 license: open_source
15 generated_by: 'Module::Build version 0.4231, CPAN::Meta::Converter version 2.150010'
16 license: gpl
1717 meta-spec:
1818 url: http://module-build.sourceforge.net/META-spec-v1.4.html
19 version: 1.4
19 version: '1.4'
2020 name: Nagios-Object
2121 provides:
2222 Nagios::Config:
2323 file: lib/Nagios/Config.pm
24 version: 36
24 version: '36'
2525 Nagios::Config::File:
2626 file: lib/Nagios/Config/File.pm
27 version: 35
27 version: '35'
2828 Nagios::Host:
2929 file: lib/Nagios/Object.pm
30 version: 0
3130 Nagios::Host::Status:
3231 file: lib/Nagios/StatusLog.pm
33 version: 0.1
32 version: '0.1'
3433 Nagios::HostGroup:
3534 file: lib/Nagios/Object.pm
36 version: 0
3735 Nagios::Info::Status:
3836 file: lib/Nagios/StatusLog.pm
39 version: 0.1
37 version: '0.1'
4038 Nagios::Object:
4139 file: lib/Nagios/Object.pm
42 version: 47
40 version: '47'
4341 Nagios::Object::Config:
4442 file: lib/Nagios/Object/Config.pm
45 version: 41
43 version: '41'
4644 Nagios::Program::Status:
4745 file: lib/Nagios/StatusLog.pm
48 version: 0.1
46 version: '0.1'
4947 Nagios::Service:
5048 file: lib/Nagios/Object.pm
51 version: 0
5249 Nagios::Service::Status:
5350 file: lib/Nagios/StatusLog.pm
54 version: 0.1
51 version: '0.1'
5552 Nagios::ServiceGroup:
5653 file: lib/Nagios/Object.pm
57 version: 0
5854 Nagios::StatusLog:
5955 file: lib/Nagios/StatusLog.pm
60 version: 45
56 version: '45'
57 Nagios::Template:
58 file: lib/Nagios/Template.pm
6159 requires:
6260 perl: v5.6.1
6361 resources:
62 Ci: https://travis-ci.org/duncs/perl-nagios-object
63 Coverage: https://coveralls.io/github/duncs/perl-nagios-object
6464 bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Nagios-Object
6565 homepage: http://github.com/duncs/perl-nagios-object
6666 license: http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt
6767 repository: http://github.com/duncs/perl-nagios-object
6868 version: v0.21.20
69 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
3636 git://github.com/duncs/perl-nagios-object.git
3737
3838 See also:
39 http://github.com/duncs/perl-nagios-object/
39 Main site:
40 http://github.com/duncs/perl-nagios-object/
41 Continuous integration tests:
42 https://travis-ci.org/duncs/perl-nagios-object
43 Coverage tests:
44 https://coveralls.io/github/duncs/perl-nagios-object
4045
4146 <duncs@cpan.org>
4247
1515
1616 =head1 USAGE
1717
18 perl statusdat_demo.pl -l /var/opt/nagios/status.dat
18 perl statusdat_demo.pl -l /var/opt/nagios/status.dat -v 2
1919
2020 =head1 NOTES
2121
2525 =cut
2626
2727 our $opt_l;
28 getopt('l:');
29 die "Must specify location of Nagios status log with -l option."
30 if ( !$opt_l );
28 our $opt_v;
29 getopt('l:v:');
30
31 if ( !$opt_l || !$opt_v ) {
32 die
33 "Must specify:\n Location of Nagios status log with -l option.\n Nagios Version with -v option\n";
34 }
3135
3236 my $bench_begin = Benchmark->new;
33 my $log = Nagios::StatusLog->new( Filename => $opt_l, Version => 2.0 );
37 my $log = Nagios::StatusLog->new( Filename => $opt_l, Version => $opt_v );
3438
3539 my $bench_postparse = Benchmark->new;
3640
2323 use Scalar::Util qw(blessed);
2424 use File::Basename qw(dirname);
2525 use File::Find qw(find);
26 use Nagios::Template;
2627 use Symbol;
2728 use Carp;
2829
318319
319320 =item find_object()
320321
321 Search through the list of objects' names and return the first match.
322 Search through the list of objects' names and return the first match, if one exists.
322323 The second argument is optional. Always using it can considerably reduce
323324 the size of the list to be searched, so it is recommended.
324325
330331 sub find_object {
331332 my ( $self, $name, $type ) = @_;
332333
333 my $searchlist;
334334 if ( $type && $type =~ /^Nagios::/ ) {
335335 my @objl = $self->find_objects($name, $type);
336 return $objl[0] if ( scalar @objl );
336 return $objl[0] if @objl;
337337 }
338338 elsif ( !$type ) {
339 $searchlist = $self->all_objects;
340
341 foreach my $obj (@$searchlist) {
342
343 #printf STDERR "obj name '%s', name searched '%s'\n", $obj->name, $name;
344 my $n = $obj->name;
345 if ( $n && $n eq $name ) {
346 return $obj;
347 }
348 }
349 }
339 foreach my $obj ( @{ $self->all_objects } ) {
340 my $n = $obj->name or next;
341 return $obj if $n eq $name;
342 }
343 }
344
345 return;
350346 }
351347
352348 =item find_objects()
541537 && defined $object->{use}
542538 && !exists $object->{_use} )
543539 {
544 my $template = $self->find_object( $object->use, ref $object );
545 $object->{_use} = $template;
540 $object->{_use} = new Nagios::Template(map {
541 $self->find_object( $_, ref $object );
542 } split /\s*,\s*/, $object->use);
546543 }
547544
548545 1;
854854 $self->_validate( $key, $value, @{ $vf->{$key} } );
855855 }
856856
857 # Nagios allows the usage of a '+' sign. This breaks member lists.
858 # Ignore the '+' sign completely for now.
857 # Nagios allows the usage of a '+' sign, meaning additive inheritance.
858 # Strip it off lest it breaks member lists, and store the attribute in
859 # _additive hash for eventual use in the "get" accessor (created in the
860 # _make_method below).
859861 if ( ref $vf->{$key}[0] eq 'ARRAY' && $value =~/^\+(.+)$/ ) {
860862 $value = $1;
863 $self->{_additive}{$key} = 1;
861864 }
862865
863866 if ( ref $vf->{$key}[0] eq 'ARRAY' && $value =~ /,/ ) {
10631066 my $self = shift;
10641067 my $value = $self->{$method};
10651068
1066 if ( defined $value || $method eq 'use' ) {
1069 if ( $method eq 'use' ) {
1070 return $value
1071 }
1072 if ( defined $value && !$self->{_additive}{$method} ) {
10671073 return $value;
10681074 }
10691075 else {
10701076 my $template = $self->template;
10711077 if ( $template && $template->can($method) ) {
1072 return $template->$method;
1078 return _append($template->$method, $value);
10731079 }
10741080 }
1075 return undef;
1081 return $value;
10761082 }; # end of anonymous "get" subroutine
10771083 }
1084 }
1085
1086 sub _append {
1087 my ($a, $b) = @_;
1088 return $b unless defined $a;
1089 return $a unless defined $b;
1090 $a = [ $a ] unless ref($a) eq 'ARRAY';
1091 $b = [ $b ] unless ref($b) eq 'ARRAY';
1092 [ @$a, @$b ]
10781093 }
10791094
10801095 sub DESTROY { }
692692 and version().
693693
694694 my $i = $log->info;
695 printf "Logfile created at %s unix epoch time for Nagios verion %s\n",
695 printf "Logfile created at %s unix epoch time for Nagios version %s\n",
696696 $i->created,
697697 $i->version;
698698
0 package Nagios::Template;
1 use strict;
2 use warnings;
3 use Carp;
4
5 sub new {
6 my $class = shift;
7 return shift if @_ == 1;
8 bless { objects => [ @_ ] }, $class
9 }
10
11 sub objects { @{shift->{objects}} }
12
13 sub can {
14 my ($self,$meth) = @_;
15 if (my $s = $self->SUPER::can($meth)) {
16 return $s;
17 }
18 foreach my $obj ($self->objects) {
19 if ($obj->can($meth)) {
20 return $obj;
21 }
22 }
23 }
24
25 our $AUTOLOAD;
26 sub AUTOLOAD {
27 my $self = shift;
28 $AUTOLOAD =~ s/(?:(.*)::)?(.+)//;
29 my ($p, $m) = ($1, $2);
30 my $has_attr;
31 foreach my $obj ($self->objects) {
32 if ($obj->can($m)) {
33 $has_attr = 1;
34 if (defined(my $v = $obj->${\$m}(@_))) {
35 return $v;
36 }
37 }
38 }
39 return if $has_attr;
40 croak "Can't locate object method \"$m\" via package \"$p\"";
41 }
42
43 1;
44
45 =head1 NAME
46
47 Nagios::Template - Perl object representing Nagios template
48
49 =head1 NOTE
50
51 Users of B<Nagios::Config> should never need to create objects of this
52 class. It is used internally by B<Nagios::Object::Config> to implement
53 template inheritance.
54
55 =head1 DESCRIPTOION
56
57 The B<Nagios::Template> implements template inheritance. The constructor
58 takes as its arguments the list of Nagios objects representing the right-
59 hand side of a "use" statement in Nagios configuration object. If only
60 one object is given (simple inheritance), the constructor returns the
61 object transparently. If given several arguments (multiple inheritance),
62 a new instance of B<Nagios::Template> is returned.
63
64 The set of attributes for an objects of this class is the union of attributes
65 supported by the objects supplied to its constructor. When an attribute
66 is requested, the B<Nagios::Template> object iterates over its underlying
67 objects and returns the first value defined. This conforms with the
68 behavior of Nagios as described in:
69
70 L<https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectinheritance.html>
71
72 =cut
73
4444 modified_service_attributes => 0,
4545 service_notification_period => "24x7",
4646 service_notifications_enabled => 1,
47 }, "Attributes for admin right" );
47 }, "Attributes for admin2 right" );
4848
4949
5050 my $host = $log->host("doesnt_exist_1");
0 ########################################
1 # NAGIOS STATUS FILE
2 #
3 # THIS FILE IS AUTOMATICALLY GENERATED
4 # BY NAGIOS. DO NOT MODIFY THIS FILE!
5 ########################################
6
7 info {
8 created=1543912399
9 version=4.3.4
10 last_update_check=0
11 update_available=0
12 last_version=
13 new_version=
14 }
15
16 programstatus {
17 modified_host_attributes=0
18 modified_service_attributes=0
19 nagios_pid=542
20 daemon_mode=0
21 program_start=1543912260
22 last_log_rotation=0
23 enable_notifications=1
24 active_service_checks_enabled=1
25 passive_service_checks_enabled=1
26 active_host_checks_enabled=1
27 passive_host_checks_enabled=1
28 enable_event_handlers=1
29 obsess_over_services=0
30 obsess_over_hosts=0
31 check_service_freshness=1
32 check_host_freshness=0
33 enable_flap_detection=1
34 process_performance_data=0
35 global_host_event_handler=
36 global_service_event_handler=
37 next_comment_id=126
38 next_downtime_id=2
39 next_event_id=5912
40 next_problem_id=2547
41 next_notification_id=856
42 active_scheduled_host_check_stats=17,42,42
43 active_ondemand_host_check_stats=14,32,32
44 passive_host_check_stats=0,0,0
45 active_scheduled_service_check_stats=149,316,316
46 active_ondemand_service_check_stats=0,0,0
47 passive_service_check_stats=0,0,0
48 cached_host_check_stats=14,32,32
49 cached_service_check_stats=0,0,0
50 external_command_stats=0,0,0
51 parallel_host_check_stats=17,42,42
52 serial_host_check_stats=0,0,0
53 }
54
55 hoststatus {
56 host_name=doesnt_exist_1
57 modified_attributes=1
58 check_command=check_host_15!-H $HOSTADDRESS$ -t 3 -w 500.0,80% -c 1000.0,100%
59 check_period=
60 notification_period=24x7
61 importance=0
62 check_interval=0.000000
63 retry_interval=1.000000
64 event_handler=
65 has_been_checked=1
66 should_be_scheduled=0
67 check_execution_time=3.186
68 check_latency=0.067
69 check_type=0
70 current_state=2
71 last_hard_state=2
72 last_event_id=24
73 current_event_id=31
74 current_problem_id=18
75 last_problem_id=0
76 plugin_output=CRITICAL - 192.168.50.10: rta nan, lost 100% with {}
77 long_plugin_output=
78 performance_data=rta=0.000ms;500.000;1000.000;0; pl=100%;80;100;;
79 last_check=1233216743
80 next_check=0
81 check_options=0
82 current_attempt=1
83 max_attempts=2
84 state_type=1
85 last_state_change=1233216701
86 last_hard_state_change=1233216701
87 last_time_up=1231947413
88 last_time_down=1231947569
89 last_time_unreachable=1231947633
90 last_notification=1233911011
91 next_notification=1233914611
92 no_more_notifications=0
93 current_notification_number=46
94 current_notification_id=553
95 notifications_enabled=1
96 problem_has_been_acknowledged=0
97 acknowledgement_type=0
98 active_checks_enabled=1
99 passive_checks_enabled=1
100 event_handler_enabled=0
101 flap_detection_enabled=1
102 process_performance_data=1
103 obsess=0
104 last_update=1233914050
105 is_flapping=0
106 percent_state_change=0.00
107 scheduled_downtime_depth=0
108 }
109
110 servicestatus {
111 host_name=doesnt_exist_1
112 service_description=TCP/IP
113 modified_attributes=1
114 check_command=check_icmp!-H $HOSTADDRESS$ -w 100.0,20% -c 500.0,60%
115 check_period=24x7
116 notification_period=24x7
117 importance=0
118 check_interval=5.000000
119 retry_interval=1.000000
120 event_handler=
121 has_been_checked=1
122 should_be_scheduled=1
123 check_execution_time=3.677
124 check_latency=0.218
125 check_type=0
126 current_state=2
127 last_hard_state=2
128 last_event_id=0
129 current_event_id=23
130 current_problem_id=17
131 last_problem_id=0
132 current_attempt=1
133 max_attempts=3
134 state_type=1
135 last_state_change=1233216735
136 last_hard_state_change=1233216735
137 last_time_ok=1231947411
138 last_time_warning=0
139 last_time_unknown=0
140 last_time_critical=1233914007
141 plugin_output=CRITICAL - 192.168.50.10: rta nan, lost 100%
142 long_plugin_output=IOS (tm) 7200 Software (C7200-P-M), Version 12.2(14)S5, EARLY DEPLOYMENT RELEASE SOFTWARE (fc2)
143 \nTAC Support: http://www.cisco.com/tac
144 \nCopyright (c) 1986-2003 by cisco Systems, Inc.
145 \nCompiled Fri 26-Sep-03 1\n
146 performance_data=rta=0.000ms;100.000;500.000;0; pl=100%;20;60;;
147 last_check=1233914007
148 next_check=1233914307
149 check_options=0
150 current_notification_number=0
151 current_notification_id=0
152 last_notification=0
153 next_notification=0
154 no_more_notifications=0
155 notifications_enabled=1
156 active_checks_enabled=1
157 passive_checks_enabled=1
158 event_handler_enabled=1
159 problem_has_been_acknowledged=0
160 acknowledgement_type=0
161 flap_detection_enabled=1
162 process_performance_data=1
163 obsess=0
164 last_update=1233914050
165 is_flapping=0
166 percent_state_change=0.00
167 scheduled_downtime_depth=0
168 }
169
170 contactstatus {
171 contact_name=admin
172 modified_attributes=0
173 modified_host_attributes=0
174 modified_service_attributes=0
175 host_notification_period=24x7
176 service_notification_period=24x7
177 last_host_notification=0
178 last_service_notification=0
179 host_notifications_enabled=1
180 service_notifications_enabled=1
181 }
182
183 contactstatus {
184 contact_name=admin2
185 modified_attributes=0
186 modified_host_attributes=0
187 modified_service_attributes=0
188 host_notification_period=24x7
189 service_notification_period=24x7
190 last_host_notification=1
191 last_service_notification=0
192 host_notifications_enabled=1
193 service_notifications_enabled=1
194 }
0 #!/usr/bin/perl
1 use strict;
2 use warnings;
3 use Test::More tests => 8;
4 use Test::NoWarnings;
5 use Test::Exception;
6
7 use lib qw( ../lib ./lib );
8 use Nagios::StatusLog;
9
10 ( my $filename = $0 ) =~ s/t$/dat/;
11
12 my $log = Nagios::StatusLog->new(
13 Filename => $filename,
14 Version => 4,
15 );
16
17 isa_ok( $log, 'Nagios::StatusLog' );
18
19 my $admin_contact = $log->contact("admin");
20 isa_ok( $admin_contact, "Nagios::Contact::Status" );
21 is_deeply( $admin_contact, {
22 contact_name => "admin",
23 host_notification_period => "24x7",
24 host_notifications_enabled => 1,
25 last_host_notification => 0,
26 last_service_notification => 0,
27 modified_attributes => 0,
28 modified_host_attributes => 0,
29 modified_service_attributes => 0,
30 service_notification_period => "24x7",
31 service_notifications_enabled => 1,
32 }, "Attributes for admin right" );
33
34 my $admin2 = $log->contact("admin2");
35 isa_ok( $admin2, "Nagios::Contact::Status");
36 is_deeply( $admin2, {
37 contact_name => "admin2",
38 host_notification_period => "24x7",
39 host_notifications_enabled => 1,
40 last_host_notification => 1,
41 last_service_notification => 0,
42 modified_attributes => 0,
43 modified_host_attributes => 0,
44 modified_service_attributes => 0,
45 service_notification_period => "24x7",
46 service_notifications_enabled => 1,
47 }, "Attributes for admin2 right" );
48
49
50 my $host = $log->host("doesnt_exist_1");
51 my $hostattrs = attributes_hash($host);
52 is_deeply( $hostattrs, {
53 'acknowledgement_type' => 0,
54 'active_checks_enabled' => 1,
55 'check_command' => 'check_host_15!-H $HOSTADDRESS$ -t 3 -w 500.0,80% -c 1000.0,100%',
56 'check_execution_time' => 3.186,
57 'check_interval' => "0.000000",
58 'check_latency' => 0.067,
59 'check_options' => 0,
60 'check_period' => '',
61 'check_type' => 0,
62 'current_attempt' => 1,
63 'current_event_id' => 31,
64 'current_notification_id' => 553,
65 'current_notification_number' => 46,
66 'current_problem_id' => 18,
67 'current_state' => 2,
68 'event_handler' => '',
69 'event_handler_enabled' => 0,
70 # 'failure_prediction_enabled' => 1,
71 'flap_detection_enabled' => 1,
72 'has_been_checked' => 1,
73 'host_name' => 'doesnt_exist_1',
74 'importance' => 0, # New for Nagios 4
75 'is_flapping' => 0,
76 'last_check' => 1233216743,
77 'last_event_id' => 24,
78 'last_hard_state' => 2,
79 'last_hard_state_change' => 1233216701,
80 'last_notification' => 1233911011,
81 'last_problem_id' => 0,
82 'last_state_change' => 1233216701,
83 'last_time_down' => 1231947569,
84 'last_time_unreachable' => 1231947633,
85 'last_time_up' => 1231947413,
86 'last_update' => 1233914050,
87 'long_plugin_output' => '',
88 'max_attempts' => 2,
89 'modified_attributes' => 1,
90 'next_check' => 0,
91 'next_notification' => 1233914611,
92 'no_more_notifications' => 0,
93 'notification_period' => '24x7',
94 'notifications_enabled' => 1,
95 # 'obsess_over_host' => 0,
96 'obsess' => 0, # New for Nagios 4
97 'passive_checks_enabled' => 1,
98 'percent_state_change' => "0.00",
99 'performance_data' => 'rta=0.000ms;500.000;1000.000;0; pl=100%;80;100;;',
100 'plugin_output' => 'CRITICAL - 192.168.50.10: rta nan, lost 100% with {}',
101 'problem_has_been_acknowledged' => 0,
102 'process_performance_data' => 1,
103 'retry_interval' => "1.000000",
104 'scheduled_downtime_depth' => 0,
105 'should_be_scheduled' => 0,
106 'state_type' => 1,
107 }, "Host attributes correct" );
108
109
110 my $service = $log->service( "doesnt_exist_1", "TCP/IP" );
111 my $serviceattrs = attributes_hash( $service );
112 is_deeply( $serviceattrs, {
113 'acknowledgement_type' => 0,
114 'active_checks_enabled' => 1,
115 'check_command' => 'check_icmp!-H $HOSTADDRESS$ -w 100.0,20% -c 500.0,60%',
116 'check_execution_time' => 3.677,
117 'check_interval' => "5.000000",
118 'check_latency' => 0.218,
119 'check_options' => 0,
120 'check_period' => '24x7',
121 'check_type' => 0,
122 'current_attempt' => 1,
123 'current_event_id' => 23,
124 'current_notification_id' => 0,
125 'current_notification_number' => 0,
126 'current_problem_id' => 17,
127 'current_state' => 2,
128 'event_handler' => '',
129 'event_handler_enabled' => 1,
130 # 'failure_prediction_enabled' => 1,
131 'flap_detection_enabled' => 1,
132 'has_been_checked' => 1,
133 'host_name' => 'doesnt_exist_1',
134 'importance' => 0, # New for Nagios 4
135 'is_flapping' => 0,
136 'last_check' => 1233914007,
137 'last_event_id' => 0,
138 'last_hard_state' => 2,
139 'last_hard_state_change' => 1233216735,
140 'last_notification' => 0,
141 'last_problem_id' => 0,
142 'last_state_change' => 1233216735,
143 'last_time_critical' => 1233914007,
144 'last_time_ok' => 1231947411,
145 'last_time_unknown' => 0,
146 'last_time_warning' => 0,
147 'last_update' => 1233914050,
148 'long_plugin_output' => 'IOS (tm) 7200 Software (C7200-P-M), Version 12.2(14)S5, EARLY DEPLOYMENT RELEASE SOFTWARE (fc2)
149 \nTAC Support: http://www.cisco.com/tac
150 \nCopyright (c) 1986-2003 by cisco Systems, Inc.
151 \nCompiled Fri 26-Sep-03 1\n',
152 'max_attempts' => 3,
153 'modified_attributes' => 1,
154 'next_check' => 1233914307,
155 'next_notification' => 0,
156 'no_more_notifications' => 0,
157 'notification_period' => '24x7',
158 'notifications_enabled' => 1,
159 # 'obsess_over_service' => 0,
160 'obsess' => 0, # New for Nagios 4
161 'passive_checks_enabled' => 1,
162 'percent_state_change' => "0.00",
163 'performance_data' => 'rta=0.000ms;100.000;500.000;0; pl=100%;20;60;;',
164 'plugin_output' => 'CRITICAL - 192.168.50.10: rta nan, lost 100%',
165 'problem_has_been_acknowledged' => 0,
166 'process_performance_data' => 1,
167 'retry_interval' => "1.000000",
168 'scheduled_downtime_depth' => 0,
169 'service_description' => 'TCP/IP',
170 'should_be_scheduled' => 1,
171 'state_type' => 1,
172 }, "service attributes okay" );
173
174 sub attributes_hash {
175 my $host = shift;
176 my %attrs = %$host;
177 delete $attrs{__parent};
178 \%attrs;
179 }
0 # An example of multiple template inheritance taken from
1 # https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/objectinheritance.html
2
3 # Generic host template
4 define host {
5 name generic-host
6 active_checks_enabled 1
7 check_interval 10
8 register 0
9 }
10
11 # Development web server template
12 define host {
13 name development-server
14 check_interval 15
15 notification_options d,u,r
16 register 0
17 }
18
19 # Development web server
20 define host {
21 use generic-host,development-server
22 host_name devweb1
23 }
24
25 #
26 # A combination of multiple template and additive inheritance.
27 #
28 define host {
29 name generichosttemplate
30 hostgroups all-servers
31 register 0
32 }
33
34 define host {
35 name template1
36 hostgroups +linux-servers,web-servers
37 use generichosttemplate
38 }
39
40 define host {
41 name template2
42 hostgroups another
43 }
44
45 define host {
46 host_name linuxserver2
47 use template1,template2
48 hostgroups +one
49 }
50
51
0 #!/usr/bin/perl -w
1
2 use strict;
3 use Test::More qw(no_plan);
4 use Test::NoWarnings;
5 use lib qw( ../lib ./lib );
6 use Data::Dumper;
7
8 $Data::Dumper::Terse = 1;
9 $Data::Dumper::Indent = 0;
10
11 eval { chdir('t') };
12
13 use Nagios::Config;
14
15 my $config = Nagios::Object::Config->new();
16 $config->parse('multipletemplates.cfg');
17
18 my $host = $config->find_object('devweb1','Nagios::Host');
19
20 is($host->check_interval, 10, 'attribute defined in both parent templates');
21 is($host->active_checks_enabled, 1, 'attribute defined in first parent template');
22 is(Dumper([$host->notification_options]), q{[['d','u','r']]},
23 'attribute defined in second parent template');
24
25 $host = $config->find_object('linuxserver2','Nagios::Host');
26 is(Dumper([$host->hostgroups]), q{[['all-servers','linux-servers','web-servers','one']]},
27 'multiple additive inheritance');
28
29 is($host->alias, undef, 'undefined attribute');
7575 $msg . " index 0 was not a Nagios::Host"
7676 );
7777 ok( ref( $element->[1] ) eq 'Nagios::Service',
78 $msg . " index 1 was not a Nagios::Host"
78 $msg . " index 1 was not a Nagios::Service"
7979 );
8080 }
8181
55
66 use lib qw( ./lib ../lib );
77
8 BEGIN { plan tests => 25; }
8 BEGIN { plan tests => 17; }
99 eval { chdir('t') };
1010
1111 use_ok('Nagios::Config');
1212
1313 ok( my $cf = Nagios::Config->new(
14 Filename => "v2_config/nagios.cfg",
15 Version => 2
14 Filename => "v3_config/nagios.cfg",
15 Version => 3
1616 ),
1717 "Nagios::Config->new()"
1818 );
4646 ok( my @hosts = $cf->list_hosts(), "\$parser->list_hosts()" );
4747 ok( my @services = $cf->list_hosts(), "\$parser->list_services()" );
4848
49 ok( my @hostgroups = $cf->list_hostgroups(), "\$parser->list_hostgroups()" );
49 my @hostgroups = $cf->list_hostgroups();
50 ok( @hostgroups, "\$parser->list_hostgroups()" );
5051
51 my @servicegroups = $cf->list_servicegroups();
52 ok( @servicegroups, "\$parser->list_servicegroups()" );
52 # diag ("host groups: " . join(', ', map { $_->hostgroup_name } @hostgroups));
53 my $linux_servers
54 = ( grep { $_->hostgroup_name eq 'linux-servers' } @hostgroups )[0];
5355
54 # diag ("service groups: " . join(', ', map { $_->servicegroup_name } @servicegroups));
55 my $svcgroup1
56 = ( grep { $_->servicegroup_name eq 'svcgroup1' } @servicegroups )[0];
56 ok( defined($linux_servers), "Found linux-servers in configuration" );
5757
58 ok( defined($svcgroup1), "Found servicegroup1 in configuration" );
58 # make sure linux-servers has 1 members, which is a host
5959
60 # make sure svcgroup1 has 3 members, each of which is a host/service pair
60 my $host_members = $linux_servers->members();
61 ok( scalar(@$host_members) == 1, "linux-servers should have 1 member" );
6162
62 my $svc_members = $svcgroup1->members();
63 ok( scalar(@$svc_members) == 3, "Servicegroup1 should have 3 members" );
64
65 # diag ("svcgroup1 members: " . join(', ', map { "[" . join(", ", @{$_} ) . "]" } @$svc_members));
63 # diag ("linux-servers members: " . join(', ', map { "[" . join(", ", @{$_} ) . "]" } @$host_members));
6664
6765 {
6866
7068 my $element = shift;
7169 my $msg = shift;
7270
73 ok( scalar(@$element) == 2, $msg . " did not have 2 entries" );
74 ok( ref( $element->[0] ) eq 'Nagios::Host',
75 $msg . " index 0 was not a Nagios::Host"
76 );
77 ok( ref( $element->[1] ) eq 'Nagios::Service',
78 $msg . " index 1 was not a Nagios::Host"
71 ok( ref( $element ) eq 'Nagios::Host',
72 $msg . " was not a Nagios::Host"
7973 );
8074 }
8175
82 checkelement( $svc_members->[0], "Servicegroup1 first entry" );
83 checkelement( $svc_members->[1], "Servicegroup1 second entry" );
84 checkelement( $svc_members->[2], "Servicegroup1 third entry" );
76 checkelement( $host_members->[0], "linux-servers first entry" );
8577 }
78
79 my @servicegroups = $cf->list_servicegroups();
80 is( scalar(@servicegroups), '0', "\$parser->list_servicegroups()" );
0 #!/usr/local/bin/perl
1
2 use strict;
3 use Test::More;
4 use Test::NoWarnings;
5
6 use lib qw( ./lib ../lib );
7
8 BEGIN { plan tests => 17; }
9 eval { chdir('t') };
10
11 use_ok('Nagios::Config');
12
13 ok( my $cf = Nagios::Config->new(
14 Filename => "v4_config/nagios.cfg",
15 Version => 4
16 ),
17 "Nagios::Config->new()"
18 );
19
20 diag("run tests to make sure inherited Nagios::Config::File methods work")
21 if ( $ENV{TEST_VERBOSE} );
22
23 is( $cf->get('allow_empty_hostgroup_assignment'),
24 '0', "get('allow_empty_hostgroup_assignment') returns 0" );
25
26 is( $cf->get('downtime_file'),
27 $cf->get_attr('downtime_file'),
28 "make sure get_attr from v0.02 still works"
29 );
30
31 ok( my $list = $cf->get('cfg_file'), "get('cfg_file')" );
32
33 is( ref($list), 'ARRAY',
34 "getting an attribute that allows multiples returns an arrayref" );
35
36 ok( @$list > 2, "arrayref from previous test has more than two elements" );
37
38 diag("run tests to make sure inherited Nagios::Config::Object methods work")
39 if ( $ENV{TEST_VERBOSE} );
40
41 ok( $cf->resolve_objects,
42 "\$parser->resolve_objects should be ok to call multiple times" );
43 ok( $cf->register_objects,
44 "\$parser->register_objects should be ok to call multiple times" );
45
46 ok( my @hosts = $cf->list_hosts(), "\$parser->list_hosts()" );
47 ok( my @services = $cf->list_hosts(), "\$parser->list_services()" );
48
49 my @hostgroups = $cf->list_hostgroups();
50 ok( @hostgroups, "\$parser->list_hostgroups()" );
51
52 # diag ("host groups: " . join(', ', map { $_->hostgroup_name } @hostgroups));
53 my $linux_servers
54 = ( grep { $_->hostgroup_name eq 'linux-servers' } @hostgroups )[0];
55
56 ok( defined($linux_servers), "Found linux-servers in configuration" );
57
58 # make sure linux-servers has 1 members, which is a host
59
60 my $host_members = $linux_servers->members();
61 is( scalar(@$host_members), '1', "linux-servers should have 1 member" );
62
63 # diag ("linux-servers members: " . join(', ', map { "[" . join(", ", @{$_} ) . "]" } @$host_members));
64
65 {
66
67 sub checkelement {
68 my $element = shift;
69 my $msg = shift;
70
71 ok( ref( $element ) eq 'Nagios::Host',
72 $msg . " was not a Nagios::Host"
73 );
74 }
75
76 checkelement( $host_members->[0], "linux-servers first entry" );
77 }
78
79 my @servicegroups = $cf->list_servicegroups();
80 ok( scalar(@servicegroups) == 0, "\$parser->list_servicegroups()" );
00 #################################################################
11 #
2 # CGI.CFG - Sample CGI Configuration File for Nagios 3.1.2
2 # CGI.CFG - Sample CGI Configuration File for Nagios 3.5.1
33 #
44 # Last Modified: 06-17-2009
55 #
1111 # The CGIs will read the main and host config files for any other
1212 # data they might need.
1313
14 main_config_file=/usr/local/nagios/etc/nagios.cfg
14 main_config_file=v3_config/nagios.cfg
1515
1616
1717
273273
274274 refresh_rate=90
275275
276 # DEFAULT PAGE LIMIT
277 # This option allows you to specify the default number of results
278 # displayed on the status.cgi. This number can be adjusted from
279 # within the UI after the initial page load. Setting this to 0
280 # will show all results.
281
282 result_limit=100
276283
277284
278285 # ESCAPE HTML TAGS
273273
274274 refresh_rate=90
275275
276 # DEFAULT PAGE LIMIT
277 # This option allows you to specify the default number of results
278 # displayed on the status.cgi. This number can be adjusted from
279 # within the UI after the initial page load. Setting this to 0
280 # will show all results.
281
282 result_limit=100
276283
277284
278285 # ESCAPE HTML TAGS
00 ###################################################################
1 # MRTG Graphs: Nagios 3.1.2 Statistics
1 # MRTG Graphs: Nagios 3.5.1 Statistics
22 #
33 # You can add the following entries to your MRTG config file to
44 # begin graphing several Nagios statistics which can be useful for
00 ##############################################################################
11 #
2 # NAGIOS.CFG - Sample Main Config File for Nagios 3.1.2
2 # NAGIOS.CFG - Sample Main Config File for Nagios 3.5.1
33 #
44 # Read the documentation for more information on this configuration
55 # file. I've provided some comments here, but things may not be so
2626 # if you wish (as shown below), or keep them all in a single config file.
2727
2828 # You can specify individual object config files as shown below:
29 cfg_file=/usr/local/nagios/etc/objects/commands.cfg
30 cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
31 cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
32 cfg_file=/usr/local/nagios/etc/objects/templates.cfg
29 cfg_file=v3_config/template-object/commands.cfg
30 cfg_file=v3_config/template-object/contacts.cfg
31 cfg_file=v3_config/template-object/timeperiods.cfg
32 cfg_file=v3_config/template-object/templates.cfg
3333
3434 # Definitions for monitoring the local (Linux) host
35 cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
35 cfg_file=v3_config/template-object/localhost.cfg
3636
3737 # Definitions for monitoring a Windows machine
38 #cfg_file=/usr/local/nagios/etc/objects/windows.cfg
38 #cfg_file=v3_config/template-object/windows.cfg
3939
4040 # Definitions for monitoring a router/switch
41 #cfg_file=/usr/local/nagios/etc/objects/switch.cfg
41 #cfg_file=v3_config/template-object/switch.cfg
4242
4343 # Definitions for monitoring a network printer
44 #cfg_file=/usr/local/nagios/etc/objects/printer.cfg
44 #cfg_file=v3_config/template-object/printer.cfg
4545
4646
4747 # You can also tell Nagios to process all config files (with a .cfg
4848 # extension) in a particular directory by using the cfg_dir
4949 # directive as shown below:
5050
51 #cfg_dir=/usr/local/nagios/etc/servers
52 #cfg_dir=/usr/local/nagios/etc/printers
53 #cfg_dir=/usr/local/nagios/etc/switches
54 #cfg_dir=/usr/local/nagios/etc/routers
51 #cfg_dir=v3_config/servers
52 #cfg_dir=v3_config/printers
53 #cfg_dir=v3_config/switches
54 #cfg_dir=v3_config/routers
5555
5656
5757
9292 # defined as macros in this file and restrictive permissions (600)
9393 # can be placed on this file.
9494
95 resource_file=/usr/local/nagios/etc/resource.cfg
95 resource_file=v3_config/resource.cfg
9696
9797
9898
633633 # service state information before it shuts down. The state
634634 # information in this file is also read immediately prior to
635635 # starting to monitor the network when Nagios is restarted.
636 # This file is used only if the preserve_state_information
636 # This file is used only if the retain_state_information
637637 # variable is set to 1.
638638
639639 state_retention_file=/usr/local/nagios/var/retention.dat
898898 #host_perfdata_file_processing_command=process-host-perfdata-file
899899 #service_perfdata_file_processing_command=process-service-perfdata-file
900900
901
902
903 # HOST AND SERVICE PERFORMANCE DATA PROCESS EMPTY RESULTS
904 # THese options determine wether the core will process empty perfdata
905 # results or not. This is needed for distributed monitoring, and intentionally
906 # turned on by default.
907 # If you don't require empty perfdata - saving some cpu cycles
908 # on unwanted macro calculation - you can turn that off. Be careful!
909 # Values: 1 = enable, 0 = disable
910
911 #host_perfdata_process_empty_results=1
912 #service_perfdata_process_empty_results=1
901913
902914
903915 # OBSESS OVER SERVICE CHECKS OPTION
10121024 # disabled service freshness checking, this option has no effect.
10131025
10141026 service_freshness_check_interval=60
1027
1028
1029
1030 # SERVICE CHECK TIMEOUT STATE
1031 # This setting determines the state Nagios will report when a
1032 # service check times out - that is does not respond within
1033 # service_check_timeout seconds. This can be useful if a
1034 # machine is running at too high a load and you do not want
1035 # to consider a failed service check to be critical (the default).
1036 # Valid settings are:
1037 # c - Critical (default)
1038 # u - Unknown
1039 # w - Warning
1040 # o - OK
1041
1042 service_check_timeout_state=c
10151043
10161044
10171045
633633 # service state information before it shuts down. The state
634634 # information in this file is also read immediately prior to
635635 # starting to monitor the network when Nagios is restarted.
636 # This file is used only if the preserve_state_information
636 # This file is used only if the retain_state_information
637637 # variable is set to 1.
638638
639639 state_retention_file=@localstatedir@/retention.dat
898898 #host_perfdata_file_processing_command=process-host-perfdata-file
899899 #service_perfdata_file_processing_command=process-service-perfdata-file
900900
901
902
903 # HOST AND SERVICE PERFORMANCE DATA PROCESS EMPTY RESULTS
904 # THese options determine wether the core will process empty perfdata
905 # results or not. This is needed for distributed monitoring, and intentionally
906 # turned on by default.
907 # If you don't require empty perfdata - saving some cpu cycles
908 # on unwanted macro calculation - you can turn that off. Be careful!
909 # Values: 1 = enable, 0 = disable
910
911 #host_perfdata_process_empty_results=1
912 #service_perfdata_process_empty_results=1
901913
902914
903915 # OBSESS OVER SERVICE CHECKS OPTION
10121024 # disabled service freshness checking, this option has no effect.
10131025
10141026 service_freshness_check_interval=60
1027
1028
1029
1030 # SERVICE CHECK TIMEOUT STATE
1031 # This setting determines the state Nagios will report when a
1032 # service check times out - that is does not respond within
1033 # service_check_timeout seconds. This can be useful if a
1034 # machine is running at too high a load and you do not want
1035 # to consider a failed service check to be critical (the default).
1036 # Valid settings are:
1037 # c - Critical (default)
1038 # u - Unknown
1039 # w - Warning
1040 # o - OK
1041
1042 service_check_timeout_state=c
10151043
10161044
10171045
00 ###########################################################################
11 #
2 # RESOURCE.CFG - Sample Resource File for Nagios 3.1.2
2 # RESOURCE.CFG - Sample Resource File for Nagios 3.5.1
33 #
44 # Last Modified: 09-10-2003
55 #
00 ###############################################################################
1 # COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 3.1.2
1 # COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 3.5.1
22 #
33 # Last Modified: 05-31-2007
44 #
3232 # 'notify-service-by-email' command definition
3333 define command{
3434 command_name notify-service-by-email
35 command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
35 command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
3636 }
3737
3838
3232 # 'notify-service-by-email' command definition
3333 define command{
3434 command_name notify-service-by-email
35 command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
35 command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
3636 }
3737
3838
6969 monday -1 may 00:00-00:00 ; Memorial Day (last Monday in May)
7070 july 4 00:00-00:00 ; Independence Day
7171 monday 1 september 00:00-00:00 ; Labor Day (first Monday in September)
72 thursday -1 november 00:00-00:00 ; Thanksgiving (last Thursday in November)
72 thursday 4 november 00:00-00:00 ; Thanksgiving (4th Thursday in November)
7373 december 25 00:00-00:00 ; Christmas
7474 }
7575
6969 monday -1 may 00:00-00:00 ; Memorial Day (last Monday in May)
7070 july 4 00:00-00:00 ; Independence Day
7171 monday 1 september 00:00-00:00 ; Labor Day (first Monday in September)
72 thursday -1 november 00:00-00:00 ; Thanksgiving (last Thursday in November)
72 thursday 4 november 00:00-00:00 ; Thanksgiving (4th Thursday in November)
7373 december 25 00:00-00:00 ; Christmas
7474 }
7575
0 =========================
1 SAMPLE CONFIG FILE README
2 =========================
3
4 This directory contains *sample* configuration files for Nagios.
5 You should read the HTML documentation for information on
6 customizing these config files to suit your needs.
7
8 A description of the sample config files and subdirectories
9 contained here follows:
10
11
12
13 CONTENTS:
14 ---------
15
16 cgi.cfg - This is a sample CGI config file
17
18 nagios.cfg - This is a sample main config file
19
20 resource.cfg - This is a sample resource config file, used for defining
21 custom macros, storing sensitive data, etc.
22
23 httpd.conf - This file contains sample snippets that you'll need to
24 include in your Apache web server config file if you want
25 to use the web interface.
26
27 template-object/ - This directory contains sample object config files. You'll
28 need to define object config files like these before you can
29 actually start to monitor anything.
30
31
0 #################################################################
1 #
2 # CGI.CFG - Sample CGI Configuration File for Nagios 4.4.3
3 #
4 #
5 #################################################################
6
7
8 # MAIN CONFIGURATION FILE
9 # This tells the CGIs where to find your main configuration file.
10 # The CGIs will read the main and host config files for any other
11 # data they might need.
12
13 main_config_file=v4_config/nagios.cfg
14
15
16
17 # PHYSICAL HTML PATH
18 # This is the path where the HTML files for Nagios reside. This
19 # value is used to locate the logo images needed by the statusmap
20 # and statuswrl CGIs.
21
22 physical_html_path=/usr/local/nagios/share
23
24
25
26 # URL HTML PATH
27 # This is the path portion of the URL that corresponds to the
28 # physical location of the Nagios HTML files (as defined above).
29 # This value is used by the CGIs to locate the online documentation
30 # and graphics. If you access the Nagios pages with an URL like
31 # http://www.myhost.com/nagios, this value should be '/nagios'
32 # (without the quotes).
33
34 url_html_path=/nagios
35
36
37
38 # CONTEXT-SENSITIVE HELP
39 # This option determines whether or not a context-sensitive
40 # help icon will be displayed for most of the CGIs.
41 # Values: 0 = disables context-sensitive help
42 # 1 = enables context-sensitive help
43
44 show_context_help=0
45
46
47
48 # PENDING STATES OPTION
49 # This option determines what states should be displayed in the web
50 # interface for hosts/services that have not yet been checked.
51 # Values: 0 = leave hosts/services that have not been check yet in their original state
52 # 1 = mark hosts/services that have not been checked yet as PENDING
53
54 use_pending_states=1
55
56
57
58 # AUTHENTICATION USAGE
59 # This option controls whether or not the CGIs will use any
60 # authentication when displaying host and service information, as
61 # well as committing commands to Nagios for processing.
62 #
63 # Read the HTML documentation to learn how the authorization works!
64 #
65 # NOTE: It is a really *bad* idea to disable authorization, unless
66 # you plan on removing the command CGI (cmd.cgi)! Failure to do
67 # so will leave you wide open to kiddies messing with Nagios and
68 # possibly hitting you with a denial of service attack by filling up
69 # your drive by continuously writing to your command file!
70 #
71 # Setting this value to 0 will cause the CGIs to *not* use
72 # authentication (bad idea), while any other value will make them
73 # use the authentication functions (the default).
74
75 use_authentication=1
76
77
78
79 # x509 CERT AUTHENTICATION
80 # When enabled, this option allows you to use x509 cert (SSL)
81 # authentication in the CGIs. This is an advanced option and should
82 # not be enabled unless you know what you're doing.
83
84 use_ssl_authentication=0
85
86
87
88 # DEFAULT USER
89 # Setting this variable will define a default user name that can
90 # access pages without authentication. This allows people within a
91 # secure domain (i.e., behind a firewall) to see the current status
92 # without authenticating. You may want to use this to avoid basic
93 # authentication if you are not using a secure server since basic
94 # authentication transmits passwords in the clear.
95 #
96 # Important: Do not define a default username unless you are
97 # running a secure web server and are sure that everyone who has
98 # access to the CGIs has been authenticated in some manner! If you
99 # define this variable, anyone who has not authenticated to the web
100 # server will inherit all rights you assign to this user!
101
102 #default_user_name=guest
103
104
105
106 # SYSTEM/PROCESS INFORMATION ACCESS
107 # This option is a comma-delimited list of all usernames that
108 # have access to viewing the Nagios process information as
109 # provided by the Extended Information CGI (extinfo.cgi). By
110 # default, *no one* has access to this unless you choose to
111 # not use authorization. You may use an asterisk (*) to
112 # authorize any user who has authenticated to the web server.
113
114 authorized_for_system_information=nagiosadmin
115
116
117
118 # CONFIGURATION INFORMATION ACCESS
119 # This option is a comma-delimited list of all usernames that
120 # can view ALL configuration information (hosts, commands, etc).
121 # By default, users can only view configuration information
122 # for the hosts and services they are contacts for. You may use
123 # an asterisk (*) to authorize any user who has authenticated
124 # to the web server.
125
126 authorized_for_configuration_information=nagiosadmin
127
128
129
130 # SYSTEM/PROCESS COMMAND ACCESS
131 # This option is a comma-delimited list of all usernames that
132 # can issue shutdown and restart commands to Nagios via the
133 # command CGI (cmd.cgi). Users in this list can also change
134 # the program mode to active or standby. By default, *no one*
135 # has access to this unless you choose to not use authorization.
136 # You may use an asterisk (*) to authorize any user who has
137 # authenticated to the web server.
138
139 authorized_for_system_commands=nagiosadmin
140
141
142
143 # GLOBAL HOST/SERVICE VIEW ACCESS
144 # These two options are comma-delimited lists of all usernames that
145 # can view information for all hosts and services that are being
146 # monitored. By default, users can only view information
147 # for hosts or services that they are contacts for (unless you
148 # you choose to not use authorization). You may use an asterisk (*)
149 # to authorize any user who has authenticated to the web server.
150
151 authorized_for_all_services=nagiosadmin
152 authorized_for_all_hosts=nagiosadmin
153
154
155
156 # GLOBAL HOST/SERVICE COMMAND ACCESS
157 # These two options are comma-delimited lists of all usernames that
158 # can issue host or service related commands via the command
159 # CGI (cmd.cgi) for all hosts and services that are being monitored.
160 # By default, users can only issue commands for hosts or services
161 # that they are contacts for (unless you you choose to not use
162 # authorization). You may use an asterisk (*) to authorize any
163 # user who has authenticated to the web server.
164
165 authorized_for_all_service_commands=nagiosadmin
166 authorized_for_all_host_commands=nagiosadmin
167
168
169
170 # READ-ONLY USERS
171 # A comma-delimited list of usernames that have read-only rights in
172 # the CGIs. This will block any service or host commands normally shown
173 # on the extinfo CGI pages. It will also block comments from being shown
174 # to read-only users.
175
176 #authorized_for_read_only=user1,user2
177
178
179
180 # STATUSMAP BACKGROUND IMAGE
181 # This option allows you to specify an image to be used as a
182 # background in the statusmap CGI. It is assumed that the image
183 # resides in the HTML images path (i.e. /usr/local/nagios/share/images).
184 # This path is automatically determined by appending "/images"
185 # to the path specified by the 'physical_html_path' directive.
186 # Note: The image file may be in GIF, PNG, JPEG, or GD2 format.
187 # However, I recommend that you convert your image to GD2 format
188 # (uncompressed) but ONLY IF YOU WILL USE THE LEGACY MAP EXCLUSIVELY,
189 # as this will cause less CPU load when the CGI generates the image.
190
191 #statusmap_background_image=smbackground.gd2
192
193
194
195 # STATUSMAP TRANSPARENCY INDEX COLOR
196 # These options set the r,g,b values of the background color used the statusmap CGI,
197 # so normal browsers that can't show real png transparency set the desired color as
198 # a background color instead (to make it look pretty).
199 # Defaults to white: (R,G,B) = (255,255,255).
200
201 #color_transparency_index_r=255
202 #color_transparency_index_g=255
203 #color_transparency_index_b=255
204
205
206
207 # DEFAULT STATUSMAP LAYOUT METHOD
208 # This option allows you to specify the default layout method
209 # the statusmap CGI should use for drawing hosts. If you do
210 # not use this option, the default for the legacy map is to use
211 # user-defined coordinates and the default for the new map is "6"
212 # (Circular Balloon).
213 # Valid options for the legacy map are as follows:
214 # 0 = User-defined coordinates
215 # 1 = Depth layers
216 # 2 = Collapsed tree
217 # 3 = Balanced tree
218 # 4 = Circular
219 # 5 = Circular (Marked Up)
220 # Valid options for the new map are as follows:
221 # 0 = User-defined coordinates
222 # 1 = Depth Layers (Horizontal)
223 # 2 = Collapsed tree (Horizontal)
224 # 3 = Balanced tree (Horizontal)
225 # 4 = DON'T USE
226 # 5 = Circular Markup
227 # 6 = Circular Balloon
228 # 7 = Balanced tree (Vertical)
229 # 8 = Collapsed tree (Vertical)
230 # 9 = Depth Layers (Vertical)
231 # 10 = Force Map
232
233 #default_statusmap_layout=6
234
235
236
237 # DEFAULT STATUSWRL LAYOUT METHOD
238 # This option allows you to specify the default layout method
239 # the statuswrl (VRML) CGI should use for drawing hosts. If you
240 # do not use this option, the default is to use user-defined
241 # coordinates. Valid options are as follows:
242 # 0 = User-defined coordinates
243 # 2 = Collapsed tree
244 # 3 = Balanced tree
245 # 4 = Circular
246
247 default_statuswrl_layout=4
248
249
250
251 # STATUSWRL INCLUDE
252 # This option allows you to include your own objects in the
253 # generated VRML world. It is assumed that the file
254 # resides in the HTML path (i.e. /usr/local/nagios/share).
255
256 #statuswrl_include=myworld.wrl
257
258
259
260 # PING SYNTAX
261 # This option determines what syntax should be used when
262 # attempting to ping a host from the WAP interface (using
263 # the statuswml CGI. You must include the full path to
264 # the ping binary, along with all required options. The
265 # $HOSTADDRESS$ macro is substituted with the address of
266 # the host before the command is executed.
267 # Please note that the syntax for the ping binary is
268 # notorious for being different on virtually ever *NIX
269 # OS and distribution, so you may have to tweak this to
270 # work on your system.
271
272 ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
273
274
275
276 # REFRESH RATE
277 # This option allows you to specify the refresh rate in seconds
278 # of various CGIs (status, statusmap, extinfo, and outages).
279
280 refresh_rate=90
281
282
283
284 # PAGE TOUR
285 # Enable page tour for helpful tips and tricks on various pages
286
287 #enable_page_tour=1
288
289
290
291 # DEFAULT PAGE LIMIT
292 # This option allows you to specify the default number of results
293 # displayed on the status.cgi. This number can be adjusted from
294 # within the UI after the initial page load. Setting this to 0
295 # will show all results.
296
297 result_limit=100
298
299
300
301 # ESCAPE HTML TAGS
302 # This option determines whether HTML tags in host and service
303 # status output is escaped in the web interface. If enabled,
304 # your plugin output will not be able to contain clickable links.
305
306 escape_html_tags=1
307
308
309
310 # SOUND OPTIONS
311 # These options allow you to specify an optional audio file
312 # that should be played in your browser window when there are
313 # problems on the network. The audio files are used only in
314 # the status CGI. Only the sound for the most critical problem
315 # will be played. Order of importance (higher to lower) is as
316 # follows: unreachable hosts, down hosts, critical services,
317 # warning services, and unknown services. If there are no
318 # visible problems, the sound file optionally specified by
319 # 'normal_sound' variable will be played.
320 #
321 #
322 # <varname>=<sound_file>
323 #
324 # Note: All audio files must be placed in the /media subdirectory
325 # under the HTML path (i.e. /usr/local/nagios/share/media/).
326
327 #host_unreachable_sound=hostdown.wav
328 #host_down_sound=hostdown.wav
329 #service_critical_sound=critical.wav
330 #service_warning_sound=warning.wav
331 #service_unknown_sound=warning.wav
332 #normal_sound=noproblem.wav
333
334
335
336 # URL TARGET FRAMES
337 # These options determine the target frames in which notes and
338 # action URLs will open.
339
340 action_url_target=_blank
341 notes_url_target=_blank
342
343
344
345 # LOCK AUTHOR NAMES OPTION
346 # This option determines whether users can change the author name
347 # when submitting comments, scheduling downtime. If disabled, the
348 # author names will be locked into their contact name, as defined in Nagios.
349 # Values: 0 = allow editing author names
350 # 1 = lock author names (disallow editing)
351
352 lock_author_names=1
353
354
355
356 # SPLUNK INTEGRATION OPTIONS
357 # These options allow you to enable integration with Splunk
358 # in the web interface. If enabled, you'll be presented with
359 # "Splunk It" links in various places in the CGIs (log file,
360 # alert history, host/service detail, etc). Useful if you're
361 # trying to research why a particular problem occurred.
362 # For more information on Splunk, visit http://www.splunk.com/
363
364 # This option determines whether the Splunk integration is enabled
365 # Values: 0 = disable Splunk integration
366 # 1 = enable Splunk integration
367
368 #enable_splunk_integration=1
369
370 # This option should be the URL used to access your instance of Splunk
371 #splunk_url=http://127.0.0.1:8000/
372
373
374
375 # NAVIGATION BAR SEARCH OPTIONS
376 # The following options allow to configure the navbar search. Default
377 # is to search for hostnames. With enabled navbar_search_for_addresses,
378 # the navbar search queries IP addresses as well. It's also possible
379 # to enable search for aliases by setting navbar_search_for_aliases=1.
380
381 navbar_search_for_addresses=1
382 navbar_search_for_aliases=1
383
384
385
386 # DEFAULTS FOR CHECKBOXES FOR ACKNOWLEDGEMENTS
387 # Enabling ack_no_sticky will default the "Sticky Acknowledgement" to
388 # be unchecked.
389 # Enabling ack_no_send will default the "Send Notification" to
390 # be unchecked.
391
392 #ack_no_sticky=0
393 #ack_no_send=0
394
395
396
397 # SHOW ONLY HARD STATES IS TACTICAL OVERVIEW
398 # This option controls whether only HARD states are counted on the
399 # Tactical Overview, or if both HARD and SOFT states are counted.
400 # Set to 1 to show only HARD states. Defaults to 0 (HARD+SOFT).
401
402 #tac_cgi_hard_only=0
403
404
405
406 # COMMAND COMMENTS
407 # These options control whether or not comments are required, optional,
408 # or not allowed for specific commands. The format for each line is:
409 # cmd-name=req,def-comment
410 #
411 # cmd-name is "CMT_" plus a command such as ADD_HOST_COMMENT
412 # req 0 = not allowed, 1 = optional, 2 = required
413 # def-comment optional default comment that will be put in the input field
414 #
415 # The following examples override the default comment requirements in
416 # some way.
417
418 #CMT_ADD_HOST_COMMENT=1
419 #CMT_ACKNOWLEDGE_HOST_PROBLEM=2,"Problem is being looked into"
420 #CMT_SCHEDULE_SVC_CHECK=1
421 #CMT_SCHEDULE_HOST_DOWNTIME=0
0 #################################################################
1 #
2 # CGI.CFG - Sample CGI Configuration File for Nagios @VERSION@
3 #
4 #
5 #################################################################
6
7
8 # MAIN CONFIGURATION FILE
9 # This tells the CGIs where to find your main configuration file.
10 # The CGIs will read the main and host config files for any other
11 # data they might need.
12
13 main_config_file=@sysconfdir@/nagios.cfg
14
15
16
17 # PHYSICAL HTML PATH
18 # This is the path where the HTML files for Nagios reside. This
19 # value is used to locate the logo images needed by the statusmap
20 # and statuswrl CGIs.
21
22 physical_html_path=@datadir@
23
24
25
26 # URL HTML PATH
27 # This is the path portion of the URL that corresponds to the
28 # physical location of the Nagios HTML files (as defined above).
29 # This value is used by the CGIs to locate the online documentation
30 # and graphics. If you access the Nagios pages with an URL like
31 # http://www.myhost.com/nagios, this value should be '/nagios'
32 # (without the quotes).
33
34 url_html_path=@htmurl@
35
36
37
38 # CONTEXT-SENSITIVE HELP
39 # This option determines whether or not a context-sensitive
40 # help icon will be displayed for most of the CGIs.
41 # Values: 0 = disables context-sensitive help
42 # 1 = enables context-sensitive help
43
44 show_context_help=0
45
46
47
48 # PENDING STATES OPTION
49 # This option determines what states should be displayed in the web
50 # interface for hosts/services that have not yet been checked.
51 # Values: 0 = leave hosts/services that have not been check yet in their original state
52 # 1 = mark hosts/services that have not been checked yet as PENDING
53
54 use_pending_states=1
55
56
57
58 # AUTHENTICATION USAGE
59 # This option controls whether or not the CGIs will use any
60 # authentication when displaying host and service information, as
61 # well as committing commands to Nagios for processing.
62 #
63 # Read the HTML documentation to learn how the authorization works!
64 #
65 # NOTE: It is a really *bad* idea to disable authorization, unless
66 # you plan on removing the command CGI (cmd.cgi)! Failure to do
67 # so will leave you wide open to kiddies messing with Nagios and
68 # possibly hitting you with a denial of service attack by filling up
69 # your drive by continuously writing to your command file!
70 #
71 # Setting this value to 0 will cause the CGIs to *not* use
72 # authentication (bad idea), while any other value will make them
73 # use the authentication functions (the default).
74
75 use_authentication=1
76
77
78
79 # x509 CERT AUTHENTICATION
80 # When enabled, this option allows you to use x509 cert (SSL)
81 # authentication in the CGIs. This is an advanced option and should
82 # not be enabled unless you know what you're doing.
83
84 use_ssl_authentication=0
85
86
87
88 # DEFAULT USER
89 # Setting this variable will define a default user name that can
90 # access pages without authentication. This allows people within a
91 # secure domain (i.e., behind a firewall) to see the current status
92 # without authenticating. You may want to use this to avoid basic
93 # authentication if you are not using a secure server since basic
94 # authentication transmits passwords in the clear.
95 #
96 # Important: Do not define a default username unless you are
97 # running a secure web server and are sure that everyone who has
98 # access to the CGIs has been authenticated in some manner! If you
99 # define this variable, anyone who has not authenticated to the web
100 # server will inherit all rights you assign to this user!
101
102 #default_user_name=guest
103
104
105
106 # SYSTEM/PROCESS INFORMATION ACCESS
107 # This option is a comma-delimited list of all usernames that
108 # have access to viewing the Nagios process information as
109 # provided by the Extended Information CGI (extinfo.cgi). By
110 # default, *no one* has access to this unless you choose to
111 # not use authorization. You may use an asterisk (*) to
112 # authorize any user who has authenticated to the web server.
113
114 authorized_for_system_information=nagiosadmin
115
116
117
118 # CONFIGURATION INFORMATION ACCESS
119 # This option is a comma-delimited list of all usernames that
120 # can view ALL configuration information (hosts, commands, etc).
121 # By default, users can only view configuration information
122 # for the hosts and services they are contacts for. You may use
123 # an asterisk (*) to authorize any user who has authenticated
124 # to the web server.
125
126 authorized_for_configuration_information=nagiosadmin
127
128
129
130 # SYSTEM/PROCESS COMMAND ACCESS
131 # This option is a comma-delimited list of all usernames that
132 # can issue shutdown and restart commands to Nagios via the
133 # command CGI (cmd.cgi). Users in this list can also change
134 # the program mode to active or standby. By default, *no one*
135 # has access to this unless you choose to not use authorization.
136 # You may use an asterisk (*) to authorize any user who has
137 # authenticated to the web server.
138
139 authorized_for_system_commands=nagiosadmin
140
141
142
143 # GLOBAL HOST/SERVICE VIEW ACCESS
144 # These two options are comma-delimited lists of all usernames that
145 # can view information for all hosts and services that are being
146 # monitored. By default, users can only view information
147 # for hosts or services that they are contacts for (unless you
148 # you choose to not use authorization). You may use an asterisk (*)
149 # to authorize any user who has authenticated to the web server.
150
151 authorized_for_all_services=nagiosadmin
152 authorized_for_all_hosts=nagiosadmin
153
154
155
156 # GLOBAL HOST/SERVICE COMMAND ACCESS
157 # These two options are comma-delimited lists of all usernames that
158 # can issue host or service related commands via the command
159 # CGI (cmd.cgi) for all hosts and services that are being monitored.
160 # By default, users can only issue commands for hosts or services
161 # that they are contacts for (unless you you choose to not use
162 # authorization). You may use an asterisk (*) to authorize any
163 # user who has authenticated to the web server.
164
165 authorized_for_all_service_commands=nagiosadmin
166 authorized_for_all_host_commands=nagiosadmin
167
168
169
170 # READ-ONLY USERS
171 # A comma-delimited list of usernames that have read-only rights in
172 # the CGIs. This will block any service or host commands normally shown
173 # on the extinfo CGI pages. It will also block comments from being shown
174 # to read-only users.
175
176 #authorized_for_read_only=user1,user2
177
178
179
180 # STATUSMAP BACKGROUND IMAGE
181 # This option allows you to specify an image to be used as a
182 # background in the statusmap CGI. It is assumed that the image
183 # resides in the HTML images path (i.e. /usr/local/nagios/share/images).
184 # This path is automatically determined by appending "/images"
185 # to the path specified by the 'physical_html_path' directive.
186 # Note: The image file may be in GIF, PNG, JPEG, or GD2 format.
187 # However, I recommend that you convert your image to GD2 format
188 # (uncompressed) but ONLY IF YOU WILL USE THE LEGACY MAP EXCLUSIVELY,
189 # as this will cause less CPU load when the CGI generates the image.
190
191 #statusmap_background_image=smbackground.gd2
192
193
194
195 # STATUSMAP TRANSPARENCY INDEX COLOR
196 # These options set the r,g,b values of the background color used the statusmap CGI,
197 # so normal browsers that can't show real png transparency set the desired color as
198 # a background color instead (to make it look pretty).
199 # Defaults to white: (R,G,B) = (255,255,255).
200
201 #color_transparency_index_r=255
202 #color_transparency_index_g=255
203 #color_transparency_index_b=255
204
205
206
207 # DEFAULT STATUSMAP LAYOUT METHOD
208 # This option allows you to specify the default layout method
209 # the statusmap CGI should use for drawing hosts. If you do
210 # not use this option, the default for the legacy map is to use
211 # user-defined coordinates and the default for the new map is "6"
212 # (Circular Balloon).
213 # Valid options for the legacy map are as follows:
214 # 0 = User-defined coordinates
215 # 1 = Depth layers
216 # 2 = Collapsed tree
217 # 3 = Balanced tree
218 # 4 = Circular
219 # 5 = Circular (Marked Up)
220 # Valid options for the new map are as follows:
221 # 0 = User-defined coordinates
222 # 1 = Depth Layers (Horizontal)
223 # 2 = Collapsed tree (Horizontal)
224 # 3 = Balanced tree (Horizontal)
225 # 4 = DON'T USE
226 # 5 = Circular Markup
227 # 6 = Circular Balloon
228 # 7 = Balanced tree (Vertical)
229 # 8 = Collapsed tree (Vertical)
230 # 9 = Depth Layers (Vertical)
231 # 10 = Force Map
232
233 #default_statusmap_layout=6
234
235
236
237 # DEFAULT STATUSWRL LAYOUT METHOD
238 # This option allows you to specify the default layout method
239 # the statuswrl (VRML) CGI should use for drawing hosts. If you
240 # do not use this option, the default is to use user-defined
241 # coordinates. Valid options are as follows:
242 # 0 = User-defined coordinates
243 # 2 = Collapsed tree
244 # 3 = Balanced tree
245 # 4 = Circular
246
247 default_statuswrl_layout=4
248
249
250
251 # STATUSWRL INCLUDE
252 # This option allows you to include your own objects in the
253 # generated VRML world. It is assumed that the file
254 # resides in the HTML path (i.e. /usr/local/nagios/share).
255
256 #statuswrl_include=myworld.wrl
257
258
259
260 # PING SYNTAX
261 # This option determines what syntax should be used when
262 # attempting to ping a host from the WAP interface (using
263 # the statuswml CGI. You must include the full path to
264 # the ping binary, along with all required options. The
265 # $HOSTADDRESS$ macro is substituted with the address of
266 # the host before the command is executed.
267 # Please note that the syntax for the ping binary is
268 # notorious for being different on virtually ever *NIX
269 # OS and distribution, so you may have to tweak this to
270 # work on your system.
271
272 ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
273
274
275
276 # REFRESH RATE
277 # This option allows you to specify the refresh rate in seconds
278 # of various CGIs (status, statusmap, extinfo, and outages).
279
280 refresh_rate=90
281
282
283
284 # PAGE TOUR
285 # Enable page tour for helpful tips and tricks on various pages
286
287 #enable_page_tour=1
288
289
290
291 # DEFAULT PAGE LIMIT
292 # This option allows you to specify the default number of results
293 # displayed on the status.cgi. This number can be adjusted from
294 # within the UI after the initial page load. Setting this to 0
295 # will show all results.
296
297 result_limit=100
298
299
300
301 # ESCAPE HTML TAGS
302 # This option determines whether HTML tags in host and service
303 # status output is escaped in the web interface. If enabled,
304 # your plugin output will not be able to contain clickable links.
305
306 escape_html_tags=1
307
308
309
310 # SOUND OPTIONS
311 # These options allow you to specify an optional audio file
312 # that should be played in your browser window when there are
313 # problems on the network. The audio files are used only in
314 # the status CGI. Only the sound for the most critical problem
315 # will be played. Order of importance (higher to lower) is as
316 # follows: unreachable hosts, down hosts, critical services,
317 # warning services, and unknown services. If there are no
318 # visible problems, the sound file optionally specified by
319 # 'normal_sound' variable will be played.
320 #
321 #
322 # <varname>=<sound_file>
323 #
324 # Note: All audio files must be placed in the /media subdirectory
325 # under the HTML path (i.e. /usr/local/nagios/share/media/).
326
327 #host_unreachable_sound=hostdown.wav
328 #host_down_sound=hostdown.wav
329 #service_critical_sound=critical.wav
330 #service_warning_sound=warning.wav
331 #service_unknown_sound=warning.wav
332 #normal_sound=noproblem.wav
333
334
335
336 # URL TARGET FRAMES
337 # These options determine the target frames in which notes and
338 # action URLs will open.
339
340 action_url_target=_blank
341 notes_url_target=_blank
342
343
344
345 # LOCK AUTHOR NAMES OPTION
346 # This option determines whether users can change the author name
347 # when submitting comments, scheduling downtime. If disabled, the
348 # author names will be locked into their contact name, as defined in Nagios.
349 # Values: 0 = allow editing author names
350 # 1 = lock author names (disallow editing)
351
352 lock_author_names=1
353
354
355
356 # SPLUNK INTEGRATION OPTIONS
357 # These options allow you to enable integration with Splunk
358 # in the web interface. If enabled, you'll be presented with
359 # "Splunk It" links in various places in the CGIs (log file,
360 # alert history, host/service detail, etc). Useful if you're
361 # trying to research why a particular problem occurred.
362 # For more information on Splunk, visit http://www.splunk.com/
363
364 # This option determines whether the Splunk integration is enabled
365 # Values: 0 = disable Splunk integration
366 # 1 = enable Splunk integration
367
368 #enable_splunk_integration=1
369
370 # This option should be the URL used to access your instance of Splunk
371 #splunk_url=http://127.0.0.1:8000/
372
373
374
375 # NAVIGATION BAR SEARCH OPTIONS
376 # The following options allow to configure the navbar search. Default
377 # is to search for hostnames. With enabled navbar_search_for_addresses,
378 # the navbar search queries IP addresses as well. It's also possible
379 # to enable search for aliases by setting navbar_search_for_aliases=1.
380
381 navbar_search_for_addresses=1
382 navbar_search_for_aliases=1
383
384
385
386 # DEFAULTS FOR CHECKBOXES FOR ACKNOWLEDGEMENTS
387 # Enabling ack_no_sticky will default the "Sticky Acknowledgement" to
388 # be unchecked.
389 # Enabling ack_no_send will default the "Send Notification" to
390 # be unchecked.
391
392 #ack_no_sticky=0
393 #ack_no_send=0
394
395
396
397 # SHOW ONLY HARD STATES IS TACTICAL OVERVIEW
398 # This option controls whether only HARD states are counted on the
399 # Tactical Overview, or if both HARD and SOFT states are counted.
400 # Set to 1 to show only HARD states. Defaults to 0 (HARD+SOFT).
401
402 #tac_cgi_hard_only=0
403
404
405
406 # COMMAND COMMENTS
407 # These options control whether or not comments are required, optional,
408 # or not allowed for specific commands. The format for each line is:
409 # cmd-name=req,def-comment
410 #
411 # cmd-name is "CMT_" plus a command such as ADD_HOST_COMMENT
412 # req 0 = not allowed, 1 = optional, 2 = required
413 # def-comment optional default comment that will be put in the input field
414 #
415 # The following examples override the default comment requirements in
416 # some way.
417
418 #CMT_ADD_HOST_COMMENT=1
419 #CMT_ACKNOWLEDGE_HOST_PROBLEM=2,"Problem is being looked into"
420 #CMT_SCHEDULE_SVC_CHECK=1
421 #CMT_SCHEDULE_HOST_DOWNTIME=0
0 # SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
1 #
2 # This file contains examples of entries that need
3 # to be incorporated into your Apache web server
4 # configuration file. Customize the paths, etc. as
5 # needed to fit your system.
6
7 ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
8
9 <Directory "/usr/local/nagios/sbin">
10 # SSLRequireSSL
11 Options ExecCGI
12 AllowOverride None
13 <IfVersion >= 2.3>
14 <RequireAll>
15 Require all granted
16 # Require host 127.0.0.1
17
18 AuthName "Nagios Access"
19 AuthType Basic
20 AuthUserFile /usr/local/nagios/etc/htpasswd.users
21 Require valid-user
22 </RequireAll>
23 </IfVersion>
24 <IfVersion < 2.3>
25 Order allow,deny
26 Allow from all
27 # Order deny,allow
28 # Deny from all
29 # Allow from 127.0.0.1
30
31 AuthName "Nagios Access"
32 AuthType Basic
33 AuthUserFile /usr/local/nagios/etc/htpasswd.users
34 Require valid-user
35 </IfVersion>
36 </Directory>
37
38 Alias /nagios "/usr/local/nagios/share"
39
40 <Directory "/usr/local/nagios/share">
41 # SSLRequireSSL
42 Options None
43 AllowOverride None
44 <IfVersion >= 2.3>
45 <RequireAll>
46 Require all granted
47 # Require host 127.0.0.1
48
49 AuthName "Nagios Access"
50 AuthType Basic
51 AuthUserFile /usr/local/nagios/etc/htpasswd.users
52 Require valid-user
53 </RequireAll>
54 </IfVersion>
55 <IfVersion < 2.3>
56 Order allow,deny
57 Allow from all
58 # Order deny,allow
59 # Deny from all
60 # Allow from 127.0.0.1
61
62 AuthName "Nagios Access"
63 AuthType Basic
64 AuthUserFile /usr/local/nagios/etc/htpasswd.users
65 Require valid-user
66 </IfVersion>
67 </Directory>
0 # SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
1 #
2 # This file contains examples of entries that need
3 # to be incorporated into your Apache web server
4 # configuration file. Customize the paths, etc. as
5 # needed to fit your system.
6
7 ScriptAlias @cgiurl@ "@sbindir@"
8
9 <Directory "@sbindir@">
10 # SSLRequireSSL
11 Options ExecCGI
12 AllowOverride None
13 <IfVersion >= 2.3>
14 <RequireAll>
15 Require all granted
16 # Require host 127.0.0.1
17
18 AuthName "Nagios Access"
19 AuthType Basic
20 AuthUserFile @sysconfdir@/htpasswd.users
21 Require valid-user
22 </RequireAll>
23 </IfVersion>
24 <IfVersion < 2.3>
25 Order allow,deny
26 Allow from all
27 # Order deny,allow
28 # Deny from all
29 # Allow from 127.0.0.1
30
31 AuthName "Nagios Access"
32 AuthType Basic
33 AuthUserFile @sysconfdir@/htpasswd.users
34 Require valid-user
35 </IfVersion>
36 </Directory>
37
38 Alias @htmurl@ "@datadir@"
39
40 <Directory "@datadir@">
41 # SSLRequireSSL
42 Options None
43 AllowOverride None
44 <IfVersion >= 2.3>
45 <RequireAll>
46 Require all granted
47 # Require host 127.0.0.1
48
49 AuthName "Nagios Access"
50 AuthType Basic
51 AuthUserFile @sysconfdir@/htpasswd.users
52 Require valid-user
53 </RequireAll>
54 </IfVersion>
55 <IfVersion < 2.3>
56 Order allow,deny
57 Allow from all
58 # Order deny,allow
59 # Deny from all
60 # Allow from 127.0.0.1
61
62 AuthName "Nagios Access"
63 AuthType Basic
64 AuthUserFile @sysconfdir@/htpasswd.users
65 Require valid-user
66 </IfVersion>
67 </Directory>
0 ###################################################################
1 # MRTG Graphs: Nagios 4.4.3 Statistics
2 #
3 # You can add the following entries to your MRTG config file to
4 # begin graphing several Nagios statistics which can be useful for
5 # debugging and trending purposes. The nagiostats binary (which is
6 # included as part of the Nagios distribution) is used to generate
7 # the data.
8 ###################################################################
9
10 # Service Latency and Execution Time
11 Target[nagios-a]: `/usr/local/nagios/bin/nagiostats --mrtg --data=AVGACTSVCLAT,AVGACTSVCEXT,PROGRUNTIME,NAGIOSVERPID`
12 MaxBytes[nagios-a]: 100000
13 Title[nagios-a]: Average Service Check Latency and Execution Time
14 PageTop[nagios-a]: <H1>Average Service Check Latency and Execution Time</H1>
15 Options[nagios-a]: growright,gauge,nopercent
16 YLegend[nagios-a]: Milliseconds
17 ShortLegend[nagios-a]: &nbsp;
18 LegendI[nagios-a]: &nbsp;Latency:
19 LegendO[nagios-a]: &nbsp;Execution Time:
20 Legend1[nagios-a]: Latency
21 Legend2[nagios-a]: Execution Time
22 Legend3[nagios-a]: Maximal 5 Minute Latency
23 Legend4[nagios-a]: Maximal 5 Minute Execution Time
24
25
26 # Service Percent State Change
27 Target[nagios-b]: `/usr/local/nagios/bin/nagiostats --mrtg --data=AVGACTSVCPSC,AVGPSVSVCPSC,PROGRUNTIME,NAGIOSVERPID`
28 MaxBytes[nagios-b]: 100
29 Title[nagios-b]: Average Service State Change
30 PageTop[nagios-b]: <H1>Average Service State Change</H1>
31 Options[nagios-b]: growright,gauge,nopercent
32 YLegend[nagios-b]: Percent
33 ShortLegend[nagios-b]: &nbsp;
34 LegendI[nagios-b]: &nbsp;Active Check % Change:
35 LegendO[nagios-b]: &nbsp;Passive Check % Change:
36 Legend1[nagios-b]: State Change
37 Legend2[nagios-b]: State Change
38 Legend3[nagios-b]: Maximal 5 Minute State Change
39 Legend4[nagios-b]: Maximal 5 Minute State Change
40
41
42 # Host Latency and Execution Time
43 Target[nagios-c]: `/usr/local/nagios/bin/nagiostats --mrtg --data=AVGACTHSTLAT,AVGACTHSTEXT,PROGRUNTIME,NAGIOSVERPID`
44 MaxBytes[nagios-c]: 100000
45 Title[nagios-c]: Average Host Check Latency and Execution Time
46 PageTop[nagios-c]: <H1>Average Host Check Latency and Execution Time</H1>
47 Options[nagios-c]: growright,gauge,nopercent
48 YLegend[nagios-c]: Milliseconds
49 ShortLegend[nagios-c]: &nbsp;
50 LegendI[nagios-c]: &nbsp;Latency:
51 LegendO[nagios-c]: &nbsp;Execution Time:
52 Legend1[nagios-c]: Latency
53 Legend2[nagios-c]: Execution Time
54 Legend3[nagios-c]: Maximal 5 Minute Latency
55 Legend4[nagios-c]: Maximal 5 Minute Execution Time
56
57
58 # Host Percent State Change
59 Target[nagios-d]: `/usr/local/nagios/bin/nagiostats --mrtg --data=AVGACTHSTPSC,AVGPSVHSTPSC,PROGRUNTIME,NAGIOSVERPID`
60 MaxBytes[nagios-d]: 100
61 Title[nagios-d]: Average Host State Change
62 PageTop[nagios-d]: <H1>Average Host State Change</H1>
63 Options[nagios-d]: growright,gauge,nopercent
64 YLegend[nagios-d]: Percent
65 ShortLegend[nagios-d]: &nbsp;
66 LegendI[nagios-d]: &nbsp;Active Check % Change:
67 LegendO[nagios-d]: &nbsp;Passive Check % Change:
68 Legend1[nagios-d]: State Change
69 Legend2[nagios-d]: State Change
70 Legend3[nagios-d]: Maximal 5 Minute State Change
71 Legend4[nagios-d]: Maximal 5 Minute State Change
72
73
74 # Hosts/Services Actively Checked
75 Target[nagios-e]: `/usr/local/nagios/bin/nagiostats --mrtg --data=NUMHSTACTCHK5M,NUMSVCACTCHK5M,PROGRUNTIME,NAGIOSVERPID`
76 MaxBytes[nagios-e]: 7000
77 Title[nagios-e]: Hosts/Services Actively Checked
78 PageTop[nagios-e]: <H1>Hosts/Services Actively Checked</H1>
79 Options[nagios-e]: growright,gauge,nopercent
80 YLegend[nagios-e]: Total
81 ShortLegend[nagios-e]: &nbsp;
82 LegendI[nagios-e]: &nbsp;Hosts:
83 LegendO[nagios-e]: &nbsp;Services:
84
85
86 # Hosts/Services Passively Checked
87 Target[nagios-f]: `/usr/local/nagios/bin/nagiostats --mrtg --data=NUMHSTPSVCHK5M,NUMSVCPSVCHK5M,PROGRUNTIME,NAGIOSVERPID`
88 MaxBytes[nagios-f]: 7000
89 Title[nagios-f]: Hosts/Services Passively Checked
90 PageTop[nagios-f]: <H1>Hosts/Services Passively Checked</H1>
91 Options[nagios-f]: growright,gauge,nopercent
92 YLegend[nagios-f]: Total
93 ShortLegend[nagios-f]: &nbsp;
94 LegendI[nagios-f]: &nbsp;Hosts:
95 LegendO[nagios-f]: &nbsp;Services:
96
97
98 # Used/Avail External Command Buffers
99 Target[nagios-g]: `/usr/local/nagios/bin/nagiostats --mrtg --data=TOTCMDBUF,USEDCMDBUF,PROGRUNTIME,NAGIOSVERPID`
100 MaxBytes[nagios-g]: 7000
101 Title[nagios-g]: External Command Buffers
102 PageTop[nagios-g]: <H1>External Command Buffers</H1>
103 Options[nagios-g]: growright,gauge,nopercent
104 YLegend[nagios-g]: Buffers
105 ShortLegend[nagios-g]: &nbsp;
106 LegendI[nagios-g]: &nbsp;Total:
107 LegendO[nagios-g]: &nbsp;Used:
108
109
110 # Active Host Checks
111 Target[nagios-i]: `/usr/local/nagios/bin/nagiostats --mrtg --data=NUMSACTHSTCHECKS5M,NUMOACTHSTCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
112 MaxBytes[nagios-i]: 7000
113 Title[nagios-i]: Active Host Checks
114 PageTop[nagios-i]: <H1>Active Host Checks</H1>
115 Options[nagios-i]: growright,gauge,nopercent
116 YLegend[nagios-i]: Checks
117 ShortLegend[nagios-i]: &nbsp;
118 LegendI[nagios-i]: &nbsp;Scheduled Checks:
119 LegendO[nagios-i]: &nbsp;On-Demand Checks:
120
121
122 # Active Service Checks
123 Target[nagios-j]: `/usr/local/nagios/bin/nagiostats --mrtg --data=NUMSACTSVCCHECKS5M,NUMOACTSVCCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
124 MaxBytes[nagios-j]: 7000
125 Title[nagios-j]: Active Service Checks
126 PageTop[nagios-j]: <H1>Active Service Checks</H1>
127 Options[nagios-j]: growright,gauge,nopercent
128 YLegend[nagios-j]: Checks
129 ShortLegend[nagios-j]: &nbsp;
130 LegendI[nagios-j]: &nbsp;Scheduled Checks:
131 LegendO[nagios-j]: &nbsp;On-Demand Checks:
132
133
134 # Passive Host/Service Checks
135 Target[nagios-k]: `/usr/local/nagios/bin/nagiostats --mrtg --data=NUMPSVHSTCHECKS5M,NUMPSVSVCCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
136 MaxBytes[nagios-k]: 7000
137 Title[nagios-k]: Passive Host/Service Checks
138 PageTop[nagios-k]: <H1>Passive Host/Service Checks</H1>
139 Options[nagios-k]: growright,gauge,nopercent
140 YLegend[nagios-k]: Checks
141 ShortLegend[nagios-k]: &nbsp;
142 LegendI[nagios-k]: &nbsp;Host Checks:
143 LegendO[nagios-k]: &nbsp;Service Checks:
144
145
146 # Cached Host/Service Checks
147 Target[nagios-l]: `/usr/local/nagios/bin/nagiostats --mrtg --data=NUMCACHEDHSTCHECKS5M,NUMCACHEDSVCCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
148 MaxBytes[nagios-l]: 7000
149 Title[nagios-l]: Cached Host/Service Checks
150 PageTop[nagios-l]: <H1>Cached Host/Service Checks</H1>
151 Options[nagios-l]: growright,gauge,nopercent
152 YLegend[nagios-l]: Checks
153 ShortLegend[nagios-l]: &nbsp;
154 LegendI[nagios-l]: &nbsp;Host Checks:
155 LegendO[nagios-l]: &nbsp;Service Checks:
156
157
158 # External Commands
159 Target[nagios-m]: `/usr/local/nagios/bin/nagiostats --mrtg --data=NUMEXTCMDS5M,0,PROGRUNTIME,NAGIOSVERPID`
160 MaxBytes[nagios-m]: 7000
161 Title[nagios-m]: External Commands
162 PageTop[nagios-m]: <H1>External Commands</H1>
163 Options[nagios-m]: growright,gauge,nopercent
164 YLegend[nagios-m]: Commands
165 ShortLegend[nagios-m]: &nbsp;
166 LegendI[nagios-m]: &nbsp;Commands:
167 LegendO[nagios-m]: &nbsp;
168
169
170 # Parallel/Service Host Checks
171 Target[nagios-n]: `/usr/local/nagios/bin/nagiostats --mrtg --data=NUMPARHSTCHECKS5M,NUMSERHSTCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
172 MaxBytes[nagios-n]: 7000
173 Title[nagios-n]: Parallel/Serial Host Checks
174 PageTop[nagios-n]: <H1>Parallel/Serial Host Checks</H1>
175 Options[nagios-n]: growright,gauge,nopercent
176 YLegend[nagios-n]: Checks
177 ShortLegend[nagios-n]: &nbsp;
178 LegendI[nagios-n]: &nbsp;Parallel Checks:
179 LegendO[nagios-n]: &nbsp;Serial Checks:
0 ###################################################################
1 # MRTG Graphs: Nagios @VERSION@ Statistics
2 #
3 # You can add the following entries to your MRTG config file to
4 # begin graphing several Nagios statistics which can be useful for
5 # debugging and trending purposes. The nagiostats binary (which is
6 # included as part of the Nagios distribution) is used to generate
7 # the data.
8 ###################################################################
9
10 # Service Latency and Execution Time
11 Target[nagios-a]: `@bindir@/nagiostats --mrtg --data=AVGACTSVCLAT,AVGACTSVCEXT,PROGRUNTIME,NAGIOSVERPID`
12 MaxBytes[nagios-a]: 100000
13 Title[nagios-a]: Average Service Check Latency and Execution Time
14 PageTop[nagios-a]: <H1>Average Service Check Latency and Execution Time</H1>
15 Options[nagios-a]: growright,gauge,nopercent
16 YLegend[nagios-a]: Milliseconds
17 ShortLegend[nagios-a]: &nbsp;
18 LegendI[nagios-a]: &nbsp;Latency:
19 LegendO[nagios-a]: &nbsp;Execution Time:
20 Legend1[nagios-a]: Latency
21 Legend2[nagios-a]: Execution Time
22 Legend3[nagios-a]: Maximal 5 Minute Latency
23 Legend4[nagios-a]: Maximal 5 Minute Execution Time
24
25
26 # Service Percent State Change
27 Target[nagios-b]: `@bindir@/nagiostats --mrtg --data=AVGACTSVCPSC,AVGPSVSVCPSC,PROGRUNTIME,NAGIOSVERPID`
28 MaxBytes[nagios-b]: 100
29 Title[nagios-b]: Average Service State Change
30 PageTop[nagios-b]: <H1>Average Service State Change</H1>
31 Options[nagios-b]: growright,gauge,nopercent
32 YLegend[nagios-b]: Percent
33 ShortLegend[nagios-b]: &nbsp;
34 LegendI[nagios-b]: &nbsp;Active Check % Change:
35 LegendO[nagios-b]: &nbsp;Passive Check % Change:
36 Legend1[nagios-b]: State Change
37 Legend2[nagios-b]: State Change
38 Legend3[nagios-b]: Maximal 5 Minute State Change
39 Legend4[nagios-b]: Maximal 5 Minute State Change
40
41
42 # Host Latency and Execution Time
43 Target[nagios-c]: `@bindir@/nagiostats --mrtg --data=AVGACTHSTLAT,AVGACTHSTEXT,PROGRUNTIME,NAGIOSVERPID`
44 MaxBytes[nagios-c]: 100000
45 Title[nagios-c]: Average Host Check Latency and Execution Time
46 PageTop[nagios-c]: <H1>Average Host Check Latency and Execution Time</H1>
47 Options[nagios-c]: growright,gauge,nopercent
48 YLegend[nagios-c]: Milliseconds
49 ShortLegend[nagios-c]: &nbsp;
50 LegendI[nagios-c]: &nbsp;Latency:
51 LegendO[nagios-c]: &nbsp;Execution Time:
52 Legend1[nagios-c]: Latency
53 Legend2[nagios-c]: Execution Time
54 Legend3[nagios-c]: Maximal 5 Minute Latency
55 Legend4[nagios-c]: Maximal 5 Minute Execution Time
56
57
58 # Host Percent State Change
59 Target[nagios-d]: `@bindir@/nagiostats --mrtg --data=AVGACTHSTPSC,AVGPSVHSTPSC,PROGRUNTIME,NAGIOSVERPID`
60 MaxBytes[nagios-d]: 100
61 Title[nagios-d]: Average Host State Change
62 PageTop[nagios-d]: <H1>Average Host State Change</H1>
63 Options[nagios-d]: growright,gauge,nopercent
64 YLegend[nagios-d]: Percent
65 ShortLegend[nagios-d]: &nbsp;
66 LegendI[nagios-d]: &nbsp;Active Check % Change:
67 LegendO[nagios-d]: &nbsp;Passive Check % Change:
68 Legend1[nagios-d]: State Change
69 Legend2[nagios-d]: State Change
70 Legend3[nagios-d]: Maximal 5 Minute State Change
71 Legend4[nagios-d]: Maximal 5 Minute State Change
72
73
74 # Hosts/Services Actively Checked
75 Target[nagios-e]: `@bindir@/nagiostats --mrtg --data=NUMHSTACTCHK5M,NUMSVCACTCHK5M,PROGRUNTIME,NAGIOSVERPID`
76 MaxBytes[nagios-e]: 7000
77 Title[nagios-e]: Hosts/Services Actively Checked
78 PageTop[nagios-e]: <H1>Hosts/Services Actively Checked</H1>
79 Options[nagios-e]: growright,gauge,nopercent
80 YLegend[nagios-e]: Total
81 ShortLegend[nagios-e]: &nbsp;
82 LegendI[nagios-e]: &nbsp;Hosts:
83 LegendO[nagios-e]: &nbsp;Services:
84
85
86 # Hosts/Services Passively Checked
87 Target[nagios-f]: `@bindir@/nagiostats --mrtg --data=NUMHSTPSVCHK5M,NUMSVCPSVCHK5M,PROGRUNTIME,NAGIOSVERPID`
88 MaxBytes[nagios-f]: 7000
89 Title[nagios-f]: Hosts/Services Passively Checked
90 PageTop[nagios-f]: <H1>Hosts/Services Passively Checked</H1>
91 Options[nagios-f]: growright,gauge,nopercent
92 YLegend[nagios-f]: Total
93 ShortLegend[nagios-f]: &nbsp;
94 LegendI[nagios-f]: &nbsp;Hosts:
95 LegendO[nagios-f]: &nbsp;Services:
96
97
98 # Used/Avail External Command Buffers
99 Target[nagios-g]: `@bindir@/nagiostats --mrtg --data=TOTCMDBUF,USEDCMDBUF,PROGRUNTIME,NAGIOSVERPID`
100 MaxBytes[nagios-g]: 7000
101 Title[nagios-g]: External Command Buffers
102 PageTop[nagios-g]: <H1>External Command Buffers</H1>
103 Options[nagios-g]: growright,gauge,nopercent
104 YLegend[nagios-g]: Buffers
105 ShortLegend[nagios-g]: &nbsp;
106 LegendI[nagios-g]: &nbsp;Total:
107 LegendO[nagios-g]: &nbsp;Used:
108
109
110 # Active Host Checks
111 Target[nagios-i]: `@bindir@/nagiostats --mrtg --data=NUMSACTHSTCHECKS5M,NUMOACTHSTCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
112 MaxBytes[nagios-i]: 7000
113 Title[nagios-i]: Active Host Checks
114 PageTop[nagios-i]: <H1>Active Host Checks</H1>
115 Options[nagios-i]: growright,gauge,nopercent
116 YLegend[nagios-i]: Checks
117 ShortLegend[nagios-i]: &nbsp;
118 LegendI[nagios-i]: &nbsp;Scheduled Checks:
119 LegendO[nagios-i]: &nbsp;On-Demand Checks:
120
121
122 # Active Service Checks
123 Target[nagios-j]: `@bindir@/nagiostats --mrtg --data=NUMSACTSVCCHECKS5M,NUMOACTSVCCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
124 MaxBytes[nagios-j]: 7000
125 Title[nagios-j]: Active Service Checks
126 PageTop[nagios-j]: <H1>Active Service Checks</H1>
127 Options[nagios-j]: growright,gauge,nopercent
128 YLegend[nagios-j]: Checks
129 ShortLegend[nagios-j]: &nbsp;
130 LegendI[nagios-j]: &nbsp;Scheduled Checks:
131 LegendO[nagios-j]: &nbsp;On-Demand Checks:
132
133
134 # Passive Host/Service Checks
135 Target[nagios-k]: `@bindir@/nagiostats --mrtg --data=NUMPSVHSTCHECKS5M,NUMPSVSVCCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
136 MaxBytes[nagios-k]: 7000
137 Title[nagios-k]: Passive Host/Service Checks
138 PageTop[nagios-k]: <H1>Passive Host/Service Checks</H1>
139 Options[nagios-k]: growright,gauge,nopercent
140 YLegend[nagios-k]: Checks
141 ShortLegend[nagios-k]: &nbsp;
142 LegendI[nagios-k]: &nbsp;Host Checks:
143 LegendO[nagios-k]: &nbsp;Service Checks:
144
145
146 # Cached Host/Service Checks
147 Target[nagios-l]: `@bindir@/nagiostats --mrtg --data=NUMCACHEDHSTCHECKS5M,NUMCACHEDSVCCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
148 MaxBytes[nagios-l]: 7000
149 Title[nagios-l]: Cached Host/Service Checks
150 PageTop[nagios-l]: <H1>Cached Host/Service Checks</H1>
151 Options[nagios-l]: growright,gauge,nopercent
152 YLegend[nagios-l]: Checks
153 ShortLegend[nagios-l]: &nbsp;
154 LegendI[nagios-l]: &nbsp;Host Checks:
155 LegendO[nagios-l]: &nbsp;Service Checks:
156
157
158 # External Commands
159 Target[nagios-m]: `@bindir@/nagiostats --mrtg --data=NUMEXTCMDS5M,0,PROGRUNTIME,NAGIOSVERPID`
160 MaxBytes[nagios-m]: 7000
161 Title[nagios-m]: External Commands
162 PageTop[nagios-m]: <H1>External Commands</H1>
163 Options[nagios-m]: growright,gauge,nopercent
164 YLegend[nagios-m]: Commands
165 ShortLegend[nagios-m]: &nbsp;
166 LegendI[nagios-m]: &nbsp;Commands:
167 LegendO[nagios-m]: &nbsp;
168
169
170 # Parallel/Service Host Checks
171 Target[nagios-n]: `@bindir@/nagiostats --mrtg --data=NUMPARHSTCHECKS5M,NUMSERHSTCHECKS5M,PROGRUNTIME,NAGIOSVERPID`
172 MaxBytes[nagios-n]: 7000
173 Title[nagios-n]: Parallel/Serial Host Checks
174 PageTop[nagios-n]: <H1>Parallel/Serial Host Checks</H1>
175 Options[nagios-n]: growright,gauge,nopercent
176 YLegend[nagios-n]: Checks
177 ShortLegend[nagios-n]: &nbsp;
178 LegendI[nagios-n]: &nbsp;Parallel Checks:
179 LegendO[nagios-n]: &nbsp;Serial Checks:
0 ##############################################################################
1 #
2 # NAGIOS.CFG - Sample Main Config File for Nagios 4.4.3
3 #
4 # Read the documentation for more information on this configuration
5 # file. I've provided some comments here, but things may not be so
6 # clear without further explanation.
7 #
8 #
9 ##############################################################################
10
11
12 # LOG FILE
13 # This is the main log file where service and host events are logged
14 # for historical purposes. This should be the first option specified
15 # in the config file!!!
16
17 log_file=/usr/local/nagios/var/nagios.log
18
19
20
21 # OBJECT CONFIGURATION FILE(S)
22 # These are the object configuration files in which you define hosts,
23 # host groups, contacts, contact groups, services, etc.
24 # You can split your object definitions across several config files
25 # if you wish (as shown below), or keep them all in a single config file.
26
27 # You can specify individual object config files as shown below:
28 cfg_file=v4_config/template-object/commands.cfg
29 cfg_file=v4_config/template-object/contacts.cfg
30 cfg_file=v4_config/template-object/timeperiods.cfg
31 cfg_file=v4_config/template-object/templates.cfg
32
33 # Definitions for monitoring the local (Linux) host
34 cfg_file=v4_config/template-object/localhost.cfg
35
36 # Definitions for monitoring a Windows machine
37 #cfg_file=v4_config/template-object/windows.cfg
38
39 # Definitions for monitoring a router/switch
40 #cfg_file=v4_config/template-object/switch.cfg
41
42 # Definitions for monitoring a network printer
43 #cfg_file=v4_config/template-object/printer.cfg
44
45
46 # You can also tell Nagios to process all config files (with a .cfg
47 # extension) in a particular directory by using the cfg_dir
48 # directive as shown below:
49
50 #cfg_dir=v4_config/servers
51 #cfg_dir=v4_config/printers
52 #cfg_dir=v4_config/switches
53 #cfg_dir=v4_config/routers
54
55
56
57
58 # OBJECT CACHE FILE
59 # This option determines where object definitions are cached when
60 # Nagios starts/restarts. The CGIs read object definitions from
61 # this cache file (rather than looking at the object config files
62 # directly) in order to prevent inconsistencies that can occur
63 # when the config files are modified after Nagios starts.
64
65 object_cache_file=/usr/local/nagios/var/objects.cache
66
67
68
69 # PRE-CACHED OBJECT FILE
70 # This options determines the location of the precached object file.
71 # If you run Nagios with the -p command line option, it will preprocess
72 # your object configuration file(s) and write the cached config to this
73 # file. You can then start Nagios with the -u option to have it read
74 # object definitions from this precached file, rather than the standard
75 # object configuration files (see the cfg_file and cfg_dir options above).
76 # Using a precached object file can speed up the time needed to (re)start
77 # the Nagios process if you've got a large and/or complex configuration.
78 # Read the documentation section on optimizing Nagios to find our more
79 # about how this feature works.
80
81 precached_object_file=/usr/local/nagios/var/objects.precache
82
83
84
85 # RESOURCE FILE
86 # This is an optional resource file that contains $USERx$ macro
87 # definitions. Multiple resource files can be specified by using
88 # multiple resource_file definitions. The CGIs will not attempt to
89 # read the contents of resource files, so information that is
90 # considered to be sensitive (usernames, passwords, etc) can be
91 # defined as macros in this file and restrictive permissions (600)
92 # can be placed on this file.
93
94 resource_file=v4_config/resource.cfg
95
96
97
98 # STATUS FILE
99 # This is where the current status of all monitored services and
100 # hosts is stored. Its contents are read and processed by the CGIs.
101 # The contents of the status file are deleted every time Nagios
102 # restarts.
103
104 status_file=/usr/local/nagios/var/status.dat
105
106
107
108 # STATUS FILE UPDATE INTERVAL
109 # This option determines the frequency (in seconds) that
110 # Nagios will periodically dump program, host, and
111 # service status data.
112
113 status_update_interval=10
114
115
116
117 # NAGIOS USER
118 # This determines the effective user that Nagios should run as.
119 # You can either supply a username or a UID.
120
121 nagios_user=nagios
122
123
124
125 # NAGIOS GROUP
126 # This determines the effective group that Nagios should run as.
127 # You can either supply a group name or a GID.
128
129 nagios_group=nagios
130
131
132
133 # EXTERNAL COMMAND OPTION
134 # This option allows you to specify whether or not Nagios should check
135 # for external commands (in the command file defined below).
136 # By default Nagios will check for external commands.
137 # If you want to be able to use the CGI command interface
138 # you will have to enable this.
139 # Values: 0 = disable commands, 1 = enable commands
140
141 check_external_commands=1
142
143
144
145 # EXTERNAL COMMAND FILE
146 # This is the file that Nagios checks for external command requests.
147 # It is also where the command CGI will write commands that are submitted
148 # by users, so it must be writeable by the user that the web server
149 # is running as (usually 'nobody'). Permissions should be set at the
150 # directory level instead of on the file, as the file is deleted every
151 # time its contents are processed.
152
153 command_file=/usr/local/nagios/var/rw/nagios.cmd
154
155
156
157 # QUERY HANDLER INTERFACE
158 # This is the socket that is created for the Query Handler interface
159
160 #query_socket=/usr/local/nagios/var/rw/nagios.qh
161
162
163
164 # LOCK FILE
165 # This is the lockfile that Nagios will use to store its PID number
166 # in when it is running in daemon mode.
167
168 lock_file=/run/nagios.lock
169
170
171
172 # TEMP FILE
173 # This is a temporary file that is used as scratch space when Nagios
174 # updates the status log, cleans the comment file, etc. This file
175 # is created, used, and deleted throughout the time that Nagios is
176 # running.
177
178 temp_file=/usr/local/nagios/var/nagios.tmp
179
180
181
182 # TEMP PATH
183 # This is path where Nagios can create temp files for service and
184 # host check results, etc.
185
186 temp_path=/tmp
187
188
189
190 # EVENT BROKER OPTIONS
191 # Controls what (if any) data gets sent to the event broker.
192 # Values: 0 = Broker nothing
193 # -1 = Broker everything
194 # <other> = See documentation
195
196 event_broker_options=-1
197
198
199
200 # EVENT BROKER MODULE(S)
201 # This directive is used to specify an event broker module that should
202 # by loaded by Nagios at startup. Use multiple directives if you want
203 # to load more than one module. Arguments that should be passed to
204 # the module at startup are separated from the module path by a space.
205 #
206 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
207 # WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING
208 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
209 #
210 # Do NOT overwrite modules while they are being used by Nagios or Nagios
211 # will crash in a fiery display of SEGFAULT glory. This is a bug/limitation
212 # either in dlopen(), the kernel, and/or the filesystem. And maybe Nagios...
213 #
214 # The correct/safe way of updating a module is by using one of these methods:
215 # 1. Shutdown Nagios, replace the module file, restart Nagios
216 # 2. Delete the original module file, move the new module file into place,
217 # restart Nagios
218 #
219 # Example:
220 #
221 # broker_module=<modulepath> [moduleargs]
222
223 #broker_module=/somewhere/module1.o
224 #broker_module=/somewhere/module2.o arg1 arg2=3 debug=0
225
226
227
228 # LOG ROTATION METHOD
229 # This is the log rotation method that Nagios should use to rotate
230 # the main log file. Values are as follows..
231 # n = None - don't rotate the log
232 # h = Hourly rotation (top of the hour)
233 # d = Daily rotation (midnight every day)
234 # w = Weekly rotation (midnight on Saturday evening)
235 # m = Monthly rotation (midnight last day of month)
236
237 log_rotation_method=d
238
239
240
241 # LOG ARCHIVE PATH
242 # This is the directory where archived (rotated) log files should be
243 # placed (assuming you've chosen to do log rotation).
244
245 log_archive_path=/usr/local/nagios/var/archives
246
247
248
249 # LOGGING OPTIONS
250 # If you want messages logged to the syslog facility, as well as the
251 # Nagios log file set this option to 1. If not, set it to 0.
252
253 use_syslog=1
254
255
256
257 # NOTIFICATION LOGGING OPTION
258 # If you don't want notifications to be logged, set this value to 0.
259 # If notifications should be logged, set the value to 1.
260
261 log_notifications=1
262
263
264
265 # SERVICE RETRY LOGGING OPTION
266 # If you don't want service check retries to be logged, set this value
267 # to 0. If retries should be logged, set the value to 1.
268
269 log_service_retries=1
270
271
272
273 # HOST RETRY LOGGING OPTION
274 # If you don't want host check retries to be logged, set this value to
275 # 0. If retries should be logged, set the value to 1.
276
277 log_host_retries=1
278
279
280
281 # EVENT HANDLER LOGGING OPTION
282 # If you don't want host and service event handlers to be logged, set
283 # this value to 0. If event handlers should be logged, set the value
284 # to 1.
285
286 log_event_handlers=1
287
288
289
290 # INITIAL STATES LOGGING OPTION
291 # If you want Nagios to log all initial host and service states to
292 # the main log file (the first time the service or host is checked)
293 # you can enable this option by setting this value to 1. If you
294 # are not using an external application that does long term state
295 # statistics reporting, you do not need to enable this option. In
296 # this case, set the value to 0.
297
298 log_initial_states=0
299
300
301
302 # CURRENT STATES LOGGING OPTION
303 # If you don't want Nagios to log all current host and service states
304 # after log has been rotated to the main log file, you can disable this
305 # option by setting this value to 0. Default value is 1.
306
307 log_current_states=1
308
309
310
311 # EXTERNAL COMMANDS LOGGING OPTION
312 # If you don't want Nagios to log external commands, set this value
313 # to 0. If external commands should be logged, set this value to 1.
314 # Note: This option does not include logging of passive service
315 # checks - see the option below for controlling whether or not
316 # passive checks are logged.
317
318 log_external_commands=1
319
320
321
322 # PASSIVE CHECKS LOGGING OPTION
323 # If you don't want Nagios to log passive host and service checks, set
324 # this value to 0. If passive checks should be logged, set
325 # this value to 1.
326
327 log_passive_checks=1
328
329
330
331 # GLOBAL HOST AND SERVICE EVENT HANDLERS
332 # These options allow you to specify a host and service event handler
333 # command that is to be run for every host or service state change.
334 # The global event handler is executed immediately prior to the event
335 # handler that you have optionally specified in each host or
336 # service definition. The command argument is the short name of a
337 # command definition that you define in your host configuration file.
338 # Read the HTML docs for more information.
339
340 #global_host_event_handler=somecommand
341 #global_service_event_handler=somecommand
342
343
344
345 # SERVICE INTER-CHECK DELAY METHOD
346 # This is the method that Nagios should use when initially
347 # "spreading out" service checks when it starts monitoring. The
348 # default is to use smart delay calculation, which will try to
349 # space all service checks out evenly to minimize CPU load.
350 # Using the dumb setting will cause all checks to be scheduled
351 # at the same time (with no delay between them)! This is not a
352 # good thing for production, but is useful when testing the
353 # parallelization functionality.
354 # n = None - don't use any delay between checks
355 # d = Use a "dumb" delay of 1 second between checks
356 # s = Use "smart" inter-check delay calculation
357 # x.xx = Use an inter-check delay of x.xx seconds
358
359 service_inter_check_delay_method=s
360
361
362
363 # MAXIMUM SERVICE CHECK SPREAD
364 # This variable determines the timeframe (in minutes) from the
365 # program start time that an initial check of all services should
366 # be completed. Default is 30 minutes.
367
368 max_service_check_spread=30
369
370
371
372 # SERVICE CHECK INTERLEAVE FACTOR
373 # This variable determines how service checks are interleaved.
374 # Interleaving the service checks allows for a more even
375 # distribution of service checks and reduced load on remote
376 # hosts. Setting this value to 1 is equivalent to how versions
377 # of Nagios previous to 0.0.5 did service checks. Set this
378 # value to s (smart) for automatic calculation of the interleave
379 # factor unless you have a specific reason to change it.
380 # s = Use "smart" interleave factor calculation
381 # x = Use an interleave factor of x, where x is a
382 # number greater than or equal to 1.
383
384 service_interleave_factor=s
385
386
387
388 # HOST INTER-CHECK DELAY METHOD
389 # This is the method that Nagios should use when initially
390 # "spreading out" host checks when it starts monitoring. The
391 # default is to use smart delay calculation, which will try to
392 # space all host checks out evenly to minimize CPU load.
393 # Using the dumb setting will cause all checks to be scheduled
394 # at the same time (with no delay between them)!
395 # n = None - don't use any delay between checks
396 # d = Use a "dumb" delay of 1 second between checks
397 # s = Use "smart" inter-check delay calculation
398 # x.xx = Use an inter-check delay of x.xx seconds
399
400 host_inter_check_delay_method=s
401
402
403
404 # MAXIMUM HOST CHECK SPREAD
405 # This variable determines the timeframe (in minutes) from the
406 # program start time that an initial check of all hosts should
407 # be completed. Default is 30 minutes.
408
409 max_host_check_spread=30
410
411
412
413 # MAXIMUM CONCURRENT SERVICE CHECKS
414 # This option allows you to specify the maximum number of
415 # service checks that can be run in parallel at any given time.
416 # Specifying a value of 1 for this variable essentially prevents
417 # any service checks from being parallelized. A value of 0
418 # will not restrict the number of concurrent checks that are
419 # being executed.
420
421 max_concurrent_checks=0
422
423
424
425 # HOST AND SERVICE CHECK REAPER FREQUENCY
426 # This is the frequency (in seconds!) that Nagios will process
427 # the results of host and service checks.
428
429 check_result_reaper_frequency=10
430
431
432
433
434 # MAX CHECK RESULT REAPER TIME
435 # This is the max amount of time (in seconds) that a single
436 # check result reaper event will be allowed to run before
437 # returning control back to Nagios so it can perform other
438 # duties.
439
440 max_check_result_reaper_time=30
441
442
443
444
445 # CHECK RESULT PATH
446 # This is directory where Nagios stores the results of host and
447 # service checks that have not yet been processed.
448 #
449 # Note: Make sure that only one instance of Nagios has access
450 # to this directory!
451
452 check_result_path=/usr/local/nagios/var/spool/checkresults
453
454
455
456
457 # MAX CHECK RESULT FILE AGE
458 # This option determines the maximum age (in seconds) which check
459 # result files are considered to be valid. Files older than this
460 # threshold will be mercilessly deleted without further processing.
461
462 max_check_result_file_age=3600
463
464
465
466
467 # CACHED HOST CHECK HORIZON
468 # This option determines the maximum amount of time (in seconds)
469 # that the state of a previous host check is considered current.
470 # Cached host states (from host checks that were performed more
471 # recently that the timeframe specified by this value) can immensely
472 # improve performance in regards to the host check logic.
473 # Too high of a value for this option may result in inaccurate host
474 # states being used by Nagios, while a lower value may result in a
475 # performance hit for host checks. Use a value of 0 to disable host
476 # check caching.
477
478 cached_host_check_horizon=15
479
480
481
482 # CACHED SERVICE CHECK HORIZON
483 # This option determines the maximum amount of time (in seconds)
484 # that the state of a previous service check is considered current.
485 # Cached service states (from service checks that were performed more
486 # recently that the timeframe specified by this value) can immensely
487 # improve performance in regards to predictive dependency checks.
488 # Use a value of 0 to disable service check caching.
489
490 cached_service_check_horizon=15
491
492
493
494 # ENABLE PREDICTIVE HOST DEPENDENCY CHECKS
495 # This option determines whether or not Nagios will attempt to execute
496 # checks of hosts when it predicts that future dependency logic test
497 # may be needed. These predictive checks can help ensure that your
498 # host dependency logic works well.
499 # Values:
500 # 0 = Disable predictive checks
501 # 1 = Enable predictive checks (default)
502
503 enable_predictive_host_dependency_checks=1
504
505
506
507 # ENABLE PREDICTIVE SERVICE DEPENDENCY CHECKS
508 # This option determines whether or not Nagios will attempt to execute
509 # checks of service when it predicts that future dependency logic test
510 # may be needed. These predictive checks can help ensure that your
511 # service dependency logic works well.
512 # Values:
513 # 0 = Disable predictive checks
514 # 1 = Enable predictive checks (default)
515
516 enable_predictive_service_dependency_checks=1
517
518
519
520 # SOFT STATE DEPENDENCIES
521 # This option determines whether or not Nagios will use soft state
522 # information when checking host and service dependencies. Normally
523 # Nagios will only use the latest hard host or service state when
524 # checking dependencies. If you want it to use the latest state (regardless
525 # of whether its a soft or hard state type), enable this option.
526 # Values:
527 # 0 = Don't use soft state dependencies (default)
528 # 1 = Use soft state dependencies
529
530 soft_state_dependencies=0
531
532
533
534 # TIME CHANGE ADJUSTMENT THRESHOLDS
535 # These options determine when Nagios will react to detected changes
536 # in system time (either forward or backwards).
537
538 #time_change_threshold=900
539
540
541
542 # AUTO-RESCHEDULING OPTION
543 # This option determines whether or not Nagios will attempt to
544 # automatically reschedule active host and service checks to
545 # "smooth" them out over time. This can help balance the load on
546 # the monitoring server.
547 # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
548 # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
549
550 auto_reschedule_checks=0
551
552
553
554 # AUTO-RESCHEDULING INTERVAL
555 # This option determines how often (in seconds) Nagios will
556 # attempt to automatically reschedule checks. This option only
557 # has an effect if the auto_reschedule_checks option is enabled.
558 # Default is 30 seconds.
559 # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
560 # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
561
562 auto_rescheduling_interval=30
563
564
565
566 # AUTO-RESCHEDULING WINDOW
567 # This option determines the "window" of time (in seconds) that
568 # Nagios will look at when automatically rescheduling checks.
569 # Only host and service checks that occur in the next X seconds
570 # (determined by this variable) will be rescheduled. This option
571 # only has an effect if the auto_reschedule_checks option is
572 # enabled. Default is 180 seconds (3 minutes).
573 # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
574 # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
575
576 auto_rescheduling_window=180
577
578
579
580 # TIMEOUT VALUES
581 # These options control how much time Nagios will allow various
582 # types of commands to execute before killing them off. Options
583 # are available for controlling maximum time allotted for
584 # service checks, host checks, event handlers, notifications, the
585 # ocsp command, and performance data commands. All values are in
586 # seconds.
587
588 service_check_timeout=60
589 host_check_timeout=30
590 event_handler_timeout=30
591 notification_timeout=30
592 ocsp_timeout=5
593 ochp_timeout=5
594 perfdata_timeout=5
595
596
597
598 # RETAIN STATE INFORMATION
599 # This setting determines whether or not Nagios will save state
600 # information for services and hosts before it shuts down. Upon
601 # startup Nagios will reload all saved service and host state
602 # information before starting to monitor. This is useful for
603 # maintaining long-term data on state statistics, etc, but will
604 # slow Nagios down a bit when it (re)starts. Since its only
605 # a one-time penalty, I think its well worth the additional
606 # startup delay.
607
608 retain_state_information=1
609
610
611
612 # STATE RETENTION FILE
613 # This is the file that Nagios should use to store host and
614 # service state information before it shuts down. The state
615 # information in this file is also read immediately prior to
616 # starting to monitor the network when Nagios is restarted.
617 # This file is used only if the retain_state_information
618 # variable is set to 1.
619
620 state_retention_file=/usr/local/nagios/var/retention.dat
621
622
623
624 # RETENTION DATA UPDATE INTERVAL
625 # This setting determines how often (in minutes) that Nagios
626 # will automatically save retention data during normal operation.
627 # If you set this value to 0, Nagios will not save retention
628 # data at regular interval, but it will still save retention
629 # data before shutting down or restarting. If you have disabled
630 # state retention, this option has no effect.
631
632 retention_update_interval=60
633
634
635
636 # USE RETAINED PROGRAM STATE
637 # This setting determines whether or not Nagios will set
638 # program status variables based on the values saved in the
639 # retention file. If you want to use retained program status
640 # information, set this value to 1. If not, set this value
641 # to 0.
642
643 use_retained_program_state=1
644
645
646
647 # USE RETAINED SCHEDULING INFO
648 # This setting determines whether or not Nagios will retain
649 # the scheduling info (next check time) for hosts and services
650 # based on the values saved in the retention file. If you
651 # If you want to use retained scheduling info, set this
652 # value to 1. If not, set this value to 0.
653
654 use_retained_scheduling_info=1
655
656
657
658 # RETAINED ATTRIBUTE MASKS (ADVANCED FEATURE)
659 # The following variables are used to specify specific host and
660 # service attributes that should *not* be retained by Nagios during
661 # program restarts.
662 #
663 # The values of the masks are bitwise ANDs of values specified
664 # by the "MODATTR_" definitions found in include/common.h.
665 # For example, if you do not want the current enabled/disabled state
666 # of flap detection and event handlers for hosts to be retained, you
667 # would use a value of 24 for the host attribute mask...
668 # MODATTR_EVENT_HANDLER_ENABLED (8) + MODATTR_FLAP_DETECTION_ENABLED (16) = 24
669
670 # This mask determines what host attributes are not retained
671 retained_host_attribute_mask=0
672
673 # This mask determines what service attributes are not retained
674 retained_service_attribute_mask=0
675
676 # These two masks determine what process attributes are not retained.
677 # There are two masks, because some process attributes have host and service
678 # options. For example, you can disable active host checks, but leave active
679 # service checks enabled.
680 retained_process_host_attribute_mask=0
681 retained_process_service_attribute_mask=0
682
683 # These two masks determine what contact attributes are not retained.
684 # There are two masks, because some contact attributes have host and
685 # service options. For example, you can disable host notifications for
686 # a contact, but leave service notifications enabled for them.
687 retained_contact_host_attribute_mask=0
688 retained_contact_service_attribute_mask=0
689
690
691
692 # INTERVAL LENGTH
693 # This is the seconds per unit interval as used in the
694 # host/contact/service configuration files. Setting this to 60 means
695 # that each interval is one minute long (60 seconds). Other settings
696 # have not been tested much, so your mileage is likely to vary...
697
698 interval_length=60
699
700
701
702 # CHECK FOR UPDATES
703 # This option determines whether Nagios will automatically check to
704 # see if new updates (releases) are available. It is recommend that you
705 # enable this option to ensure that you stay on top of the latest critical
706 # patches to Nagios. Nagios is critical to you - make sure you keep it in
707 # good shape. Nagios will check once a day for new updates. Data collected
708 # by Nagios Enterprises from the update check is processed in accordance
709 # with our privacy policy - see https://api.nagios.org for details.
710
711 check_for_updates=1
712
713
714
715 # BARE UPDATE CHECK
716 # This option determines what data Nagios will send to api.nagios.org when
717 # it checks for updates. By default, Nagios will send information on the
718 # current version of Nagios you have installed, as well as an indicator as
719 # to whether this was a new installation or not. Nagios Enterprises uses
720 # this data to determine the number of users running specific version of
721 # Nagios. Enable this option if you do not want this information to be sent.
722
723 bare_update_check=0
724
725
726
727 # AGGRESSIVE HOST CHECKING OPTION
728 # If you don't want to turn on aggressive host checking features, set
729 # this value to 0 (the default). Otherwise set this value to 1 to
730 # enable the aggressive check option. Read the docs for more info
731 # on what aggressive host check is or check out the source code in
732 # base/checks.c
733
734 use_aggressive_host_checking=0
735
736
737
738 # SERVICE CHECK EXECUTION OPTION
739 # This determines whether or not Nagios will actively execute
740 # service checks when it initially starts. If this option is
741 # disabled, checks are not actively made, but Nagios can still
742 # receive and process passive check results that come in. Unless
743 # you're implementing redundant hosts or have a special need for
744 # disabling the execution of service checks, leave this enabled!
745 # Values: 1 = enable checks, 0 = disable checks
746
747 execute_service_checks=1
748
749
750
751 # PASSIVE SERVICE CHECK ACCEPTANCE OPTION
752 # This determines whether or not Nagios will accept passive
753 # service checks results when it initially (re)starts.
754 # Values: 1 = accept passive checks, 0 = reject passive checks
755
756 accept_passive_service_checks=1
757
758
759
760 # HOST CHECK EXECUTION OPTION
761 # This determines whether or not Nagios will actively execute
762 # host checks when it initially starts. If this option is
763 # disabled, checks are not actively made, but Nagios can still
764 # receive and process passive check results that come in. Unless
765 # you're implementing redundant hosts or have a special need for
766 # disabling the execution of host checks, leave this enabled!
767 # Values: 1 = enable checks, 0 = disable checks
768
769 execute_host_checks=1
770
771
772
773 # PASSIVE HOST CHECK ACCEPTANCE OPTION
774 # This determines whether or not Nagios will accept passive
775 # host checks results when it initially (re)starts.
776 # Values: 1 = accept passive checks, 0 = reject passive checks
777
778 accept_passive_host_checks=1
779
780
781
782 # NOTIFICATIONS OPTION
783 # This determines whether or not Nagios will sent out any host or
784 # service notifications when it is initially (re)started.
785 # Values: 1 = enable notifications, 0 = disable notifications
786
787 enable_notifications=1
788
789
790
791 # EVENT HANDLER USE OPTION
792 # This determines whether or not Nagios will run any host or
793 # service event handlers when it is initially (re)started. Unless
794 # you're implementing redundant hosts, leave this option enabled.
795 # Values: 1 = enable event handlers, 0 = disable event handlers
796
797 enable_event_handlers=1
798
799
800
801 # PROCESS PERFORMANCE DATA OPTION
802 # This determines whether or not Nagios will process performance
803 # data returned from service and host checks. If this option is
804 # enabled, host performance data will be processed using the
805 # host_perfdata_command (defined below) and service performance
806 # data will be processed using the service_perfdata_command (also
807 # defined below). Read the HTML docs for more information on
808 # performance data.
809 # Values: 1 = process performance data, 0 = do not process performance data
810
811 process_performance_data=0
812
813
814
815 # HOST AND SERVICE PERFORMANCE DATA PROCESSING COMMANDS
816 # These commands are run after every host and service check is
817 # performed. These commands are executed only if the
818 # enable_performance_data option (above) is set to 1. The command
819 # argument is the short name of a command definition that you
820 # define in your host configuration file. Read the HTML docs for
821 # more information on performance data.
822
823 #host_perfdata_command=process-host-perfdata
824 #service_perfdata_command=process-service-perfdata
825
826
827
828 # HOST AND SERVICE PERFORMANCE DATA FILES
829 # These files are used to store host and service performance data.
830 # Performance data is only written to these files if the
831 # enable_performance_data option (above) is set to 1.
832
833 #host_perfdata_file=/usr/local/nagios/var/host-perfdata
834 #service_perfdata_file=/usr/local/nagios/var/service-perfdata
835
836
837
838 # HOST AND SERVICE PERFORMANCE DATA FILE TEMPLATES
839 # These options determine what data is written (and how) to the
840 # performance data files. The templates may contain macros, special
841 # characters (\t for tab, \r for carriage return, \n for newline)
842 # and plain text. A newline is automatically added after each write
843 # to the performance data file. Some examples of what you can do are
844 # shown below.
845
846 #host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
847 #service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
848
849
850
851 # HOST AND SERVICE PERFORMANCE DATA FILE MODES
852 # This option determines whether or not the host and service
853 # performance data files are opened in write ("w") or append ("a")
854 # mode. If you want to use named pipes, you should use the special
855 # pipe ("p") mode which avoid blocking at startup, otherwise you will
856 # likely want the default append ("a") mode.
857
858 #host_perfdata_file_mode=a
859 #service_perfdata_file_mode=a
860
861
862
863 # HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING INTERVAL
864 # These options determine how often (in seconds) the host and service
865 # performance data files are processed using the commands defined
866 # below. A value of 0 indicates the files should not be periodically
867 # processed.
868
869 #host_perfdata_file_processing_interval=0
870 #service_perfdata_file_processing_interval=0
871
872
873
874 # HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING COMMANDS
875 # These commands are used to periodically process the host and
876 # service performance data files. The interval at which the
877 # processing occurs is determined by the options above.
878
879 #host_perfdata_file_processing_command=process-host-perfdata-file
880 #service_perfdata_file_processing_command=process-service-perfdata-file
881
882
883
884 # HOST AND SERVICE PERFORMANCE DATA PROCESS EMPTY RESULTS
885 # These options determine whether the core will process empty perfdata
886 # results or not. This is needed for distributed monitoring, and intentionally
887 # turned on by default.
888 # If you don't require empty perfdata - saving some cpu cycles
889 # on unwanted macro calculation - you can turn that off. Be careful!
890 # Values: 1 = enable, 0 = disable
891
892 #host_perfdata_process_empty_results=1
893 #service_perfdata_process_empty_results=1
894
895
896 # OBSESS OVER SERVICE CHECKS OPTION
897 # This determines whether or not Nagios will obsess over service
898 # checks and run the ocsp_command defined below. Unless you're
899 # planning on implementing distributed monitoring, do not enable
900 # this option. Read the HTML docs for more information on
901 # implementing distributed monitoring.
902 # Values: 1 = obsess over services, 0 = do not obsess (default)
903
904 obsess_over_services=0
905
906
907
908 # OBSESSIVE COMPULSIVE SERVICE PROCESSOR COMMAND
909 # This is the command that is run for every service check that is
910 # processed by Nagios. This command is executed only if the
911 # obsess_over_services option (above) is set to 1. The command
912 # argument is the short name of a command definition that you
913 # define in your host configuration file. Read the HTML docs for
914 # more information on implementing distributed monitoring.
915
916 #ocsp_command=somecommand
917
918
919
920 # OBSESS OVER HOST CHECKS OPTION
921 # This determines whether or not Nagios will obsess over host
922 # checks and run the ochp_command defined below. Unless you're
923 # planning on implementing distributed monitoring, do not enable
924 # this option. Read the HTML docs for more information on
925 # implementing distributed monitoring.
926 # Values: 1 = obsess over hosts, 0 = do not obsess (default)
927
928 obsess_over_hosts=0
929
930
931
932 # OBSESSIVE COMPULSIVE HOST PROCESSOR COMMAND
933 # This is the command that is run for every host check that is
934 # processed by Nagios. This command is executed only if the
935 # obsess_over_hosts option (above) is set to 1. The command
936 # argument is the short name of a command definition that you
937 # define in your host configuration file. Read the HTML docs for
938 # more information on implementing distributed monitoring.
939
940 #ochp_command=somecommand
941
942
943
944 # TRANSLATE PASSIVE HOST CHECKS OPTION
945 # This determines whether or not Nagios will translate
946 # DOWN/UNREACHABLE passive host check results into their proper
947 # state for this instance of Nagios. This option is useful
948 # if you have distributed or failover monitoring setup. In
949 # these cases your other Nagios servers probably have a different
950 # "view" of the network, with regards to the parent/child relationship
951 # of hosts. If a distributed monitoring server thinks a host
952 # is DOWN, it may actually be UNREACHABLE from the point of
953 # this Nagios instance. Enabling this option will tell Nagios
954 # to translate any DOWN or UNREACHABLE host states it receives
955 # passively into the correct state from the view of this server.
956 # Values: 1 = perform translation, 0 = do not translate (default)
957
958 translate_passive_host_checks=0
959
960
961
962 # PASSIVE HOST CHECKS ARE SOFT OPTION
963 # This determines whether or not Nagios will treat passive host
964 # checks as being HARD or SOFT. By default, a passive host check
965 # result will put a host into a HARD state type. This can be changed
966 # by enabling this option.
967 # Values: 0 = passive checks are HARD, 1 = passive checks are SOFT
968
969 passive_host_checks_are_soft=0
970
971
972
973 # ORPHANED HOST/SERVICE CHECK OPTIONS
974 # These options determine whether or not Nagios will periodically
975 # check for orphaned host service checks. Since service checks are
976 # not rescheduled until the results of their previous execution
977 # instance are processed, there exists a possibility that some
978 # checks may never get rescheduled. A similar situation exists for
979 # host checks, although the exact scheduling details differ a bit
980 # from service checks. Orphaned checks seem to be a rare
981 # problem and should not happen under normal circumstances.
982 # If you have problems with service checks never getting
983 # rescheduled, make sure you have orphaned service checks enabled.
984 # Values: 1 = enable checks, 0 = disable checks
985
986 check_for_orphaned_services=1
987 check_for_orphaned_hosts=1
988
989
990
991 # SERVICE FRESHNESS CHECK OPTION
992 # This option determines whether or not Nagios will periodically
993 # check the "freshness" of service results. Enabling this option
994 # is useful for ensuring passive checks are received in a timely
995 # manner.
996 # Values: 1 = enabled freshness checking, 0 = disable freshness checking
997
998 check_service_freshness=1
999
1000
1001
1002 # SERVICE FRESHNESS CHECK INTERVAL
1003 # This setting determines how often (in seconds) Nagios will
1004 # check the "freshness" of service check results. If you have
1005 # disabled service freshness checking, this option has no effect.
1006
1007 service_freshness_check_interval=60
1008
1009
1010
1011 # SERVICE CHECK TIMEOUT STATE
1012 # This setting determines the state Nagios will report when a
1013 # service check times out - that is does not respond within
1014 # service_check_timeout seconds. This can be useful if a
1015 # machine is running at too high a load and you do not want
1016 # to consider a failed service check to be critical (the default).
1017 # Valid settings are:
1018 # c - Critical (default)
1019 # u - Unknown
1020 # w - Warning
1021 # o - OK
1022
1023 service_check_timeout_state=c
1024
1025
1026
1027 # HOST FRESHNESS CHECK OPTION
1028 # This option determines whether or not Nagios will periodically
1029 # check the "freshness" of host results. Enabling this option
1030 # is useful for ensuring passive checks are received in a timely
1031 # manner.
1032 # Values: 1 = enabled freshness checking, 0 = disable freshness checking
1033
1034 check_host_freshness=0
1035
1036
1037
1038 # HOST FRESHNESS CHECK INTERVAL
1039 # This setting determines how often (in seconds) Nagios will
1040 # check the "freshness" of host check results. If you have
1041 # disabled host freshness checking, this option has no effect.
1042
1043 host_freshness_check_interval=60
1044
1045
1046
1047
1048 # ADDITIONAL FRESHNESS THRESHOLD LATENCY
1049 # This setting determines the number of seconds that Nagios
1050 # will add to any host and service freshness thresholds that
1051 # it calculates (those not explicitly specified by the user).
1052
1053 additional_freshness_latency=15
1054
1055
1056
1057
1058 # FLAP DETECTION OPTION
1059 # This option determines whether or not Nagios will try
1060 # and detect hosts and services that are "flapping".
1061 # Flapping occurs when a host or service changes between
1062 # states too frequently. When Nagios detects that a
1063 # host or service is flapping, it will temporarily suppress
1064 # notifications for that host/service until it stops
1065 # flapping. Flap detection is very experimental, so read
1066 # the HTML documentation before enabling this feature!
1067 # Values: 1 = enable flap detection
1068 # 0 = disable flap detection (default)
1069
1070 enable_flap_detection=1
1071
1072
1073
1074 # FLAP DETECTION THRESHOLDS FOR HOSTS AND SERVICES
1075 # Read the HTML documentation on flap detection for
1076 # an explanation of what this option does. This option
1077 # has no effect if flap detection is disabled.
1078
1079 low_service_flap_threshold=5.0
1080 high_service_flap_threshold=20.0
1081 low_host_flap_threshold=5.0
1082 high_host_flap_threshold=20.0
1083
1084
1085
1086 # DATE FORMAT OPTION
1087 # This option determines how short dates are displayed. Valid options
1088 # include:
1089 # us (MM-DD-YYYY HH:MM:SS)
1090 # euro (DD-MM-YYYY HH:MM:SS)
1091 # iso8601 (YYYY-MM-DD HH:MM:SS)
1092 # strict-iso8601 (YYYY-MM-DDTHH:MM:SS)
1093 #
1094
1095 date_format=us
1096
1097
1098
1099
1100 # TIMEZONE OFFSET
1101 # This option is used to override the default timezone that this
1102 # instance of Nagios runs in. If not specified, Nagios will use
1103 # the system configured timezone.
1104 #
1105 # NOTE: In order to display the correct timezone in the CGIs, you
1106 # will also need to alter the Apache directives for the CGI path
1107 # to include your timezone. Example:
1108 #
1109 # <Directory "/usr/local/nagios/sbin/">
1110 # SetEnv TZ "Australia/Brisbane"
1111 # ...
1112 # </Directory>
1113
1114 #use_timezone=US/Mountain
1115 #use_timezone=Australia/Brisbane
1116
1117
1118
1119 # ILLEGAL OBJECT NAME CHARACTERS
1120 # This option allows you to specify illegal characters that cannot
1121 # be used in host names, service descriptions, or names of other
1122 # object types.
1123
1124 illegal_object_name_chars=`~!$%^&*|'"<>?,()=
1125
1126
1127
1128 # ILLEGAL MACRO OUTPUT CHARACTERS
1129 # This option allows you to specify illegal characters that are
1130 # stripped from macros before being used in notifications, event
1131 # handlers, etc. This DOES NOT affect macros used in service or
1132 # host check commands.
1133 # The following macros are stripped of the characters you specify:
1134 # $HOSTOUTPUT$
1135 # $LONGHOSTOUTPUT$
1136 # $HOSTPERFDATA$
1137 # $HOSTACKAUTHOR$
1138 # $HOSTACKCOMMENT$
1139 # $SERVICEOUTPUT$
1140 # $LONGSERVICEOUTPUT$
1141 # $SERVICEPERFDATA$
1142 # $SERVICEACKAUTHOR$
1143 # $SERVICEACKCOMMENT$
1144
1145 illegal_macro_output_chars=`~$&|'"<>
1146
1147
1148
1149 # REGULAR EXPRESSION MATCHING
1150 # This option controls whether or not regular expression matching
1151 # takes place in the object config files. Regular expression
1152 # matching is used to match host, hostgroup, service, and service
1153 # group names/descriptions in some fields of various object types.
1154 # Values: 1 = enable regexp matching, 0 = disable regexp matching
1155
1156 use_regexp_matching=0
1157
1158
1159
1160 # "TRUE" REGULAR EXPRESSION MATCHING
1161 # This option controls whether or not "true" regular expression
1162 # matching takes place in the object config files. This option
1163 # only has an effect if regular expression matching is enabled
1164 # (see above). If this option is DISABLED, regular expression
1165 # matching only occurs if a string contains wildcard characters
1166 # (* and ?). If the option is ENABLED, regexp matching occurs
1167 # all the time (which can be annoying).
1168 # Values: 1 = enable true matching, 0 = disable true matching
1169
1170 use_true_regexp_matching=0
1171
1172
1173
1174 # ADMINISTRATOR EMAIL/PAGER ADDRESSES
1175 # The email and pager address of a global administrator (likely you).
1176 # Nagios never uses these values itself, but you can access them by
1177 # using the $ADMINEMAIL$ and $ADMINPAGER$ macros in your notification
1178 # commands.
1179
1180 admin_email=nagios@localhost
1181 admin_pager=pagenagios@localhost
1182
1183
1184
1185 # DAEMON CORE DUMP OPTION
1186 # This option determines whether or not Nagios is allowed to create
1187 # a core dump when it runs as a daemon. Note that it is generally
1188 # considered bad form to allow this, but it may be useful for
1189 # debugging purposes. Enabling this option doesn't guarantee that
1190 # a core file will be produced, but that's just life...
1191 # Values: 1 - Allow core dumps
1192 # 0 - Do not allow core dumps (default)
1193
1194 daemon_dumps_core=0
1195
1196
1197
1198 # LARGE INSTALLATION TWEAKS OPTION
1199 # This option determines whether or not Nagios will take some shortcuts
1200 # which can save on memory and CPU usage in large Nagios installations.
1201 # Read the documentation for more information on the benefits/tradeoffs
1202 # of enabling this option.
1203 # Values: 1 - Enabled tweaks
1204 # 0 - Disable tweaks (default)
1205
1206 use_large_installation_tweaks=0
1207
1208
1209
1210 # ENABLE ENVIRONMENT MACROS
1211 # This option determines whether or not Nagios will make all standard
1212 # macros available as environment variables when host/service checks
1213 # and system commands (event handlers, notifications, etc.) are
1214 # executed.
1215 # Enabling this is a very bad idea for anything but very small setups,
1216 # as it means plugins, notification scripts and eventhandlers may run
1217 # out of environment space. It will also cause a significant increase
1218 # in CPU- and memory usage and drastically reduce the number of checks
1219 # you can run.
1220 # Values: 1 - Enable environment variable macros
1221 # 0 - Disable environment variable macros (default)
1222
1223 enable_environment_macros=0
1224
1225
1226
1227 # CHILD PROCESS MEMORY OPTION
1228 # This option determines whether or not Nagios will free memory in
1229 # child processes (processed used to execute system commands and host/
1230 # service checks). If you specify a value here, it will override
1231 # program defaults.
1232 # Value: 1 - Free memory in child processes
1233 # 0 - Do not free memory in child processes
1234
1235 #free_child_process_memory=1
1236
1237
1238
1239 # CHILD PROCESS FORKING BEHAVIOR
1240 # This option determines how Nagios will fork child processes
1241 # (used to execute system commands and host/service checks). Normally
1242 # child processes are fork()ed twice, which provides a very high level
1243 # of isolation from problems. Fork()ing once is probably enough and will
1244 # save a great deal on CPU usage (in large installs), so you might
1245 # want to consider using this. If you specify a value here, it will
1246 # program defaults.
1247 # Value: 1 - Child processes fork() twice
1248 # 0 - Child processes fork() just once
1249
1250 #child_processes_fork_twice=1
1251
1252
1253
1254 # DEBUG LEVEL
1255 # This option determines how much (if any) debugging information will
1256 # be written to the debug file. OR values together to log multiple
1257 # types of information.
1258 # Values:
1259 # -1 = Everything
1260 # 0 = Nothing
1261 # 1 = Functions
1262 # 2 = Configuration
1263 # 4 = Process information
1264 # 8 = Scheduled events
1265 # 16 = Host/service checks
1266 # 32 = Notifications
1267 # 64 = Event broker
1268 # 128 = External commands
1269 # 256 = Commands
1270 # 512 = Scheduled downtime
1271 # 1024 = Comments
1272 # 2048 = Macros
1273 # 4096 = Interprocess communication
1274 # 8192 = Scheduling
1275 # 16384 = Workers
1276
1277 debug_level=0
1278
1279
1280
1281 # DEBUG VERBOSITY
1282 # This option determines how verbose the debug log out will be.
1283 # Values: 0 = Brief output
1284 # 1 = More detailed
1285 # 2 = Very detailed
1286
1287 debug_verbosity=1
1288
1289
1290
1291 # DEBUG FILE
1292 # This option determines where Nagios should write debugging information.
1293
1294 debug_file=/usr/local/nagios/var/nagios.debug
1295
1296
1297
1298 # MAX DEBUG FILE SIZE
1299 # This option determines the maximum size (in bytes) of the debug file. If
1300 # the file grows larger than this size, it will be renamed with a .old
1301 # extension. If a file already exists with a .old extension it will
1302 # automatically be deleted. This helps ensure your disk space usage doesn't
1303 # get out of control when debugging Nagios.
1304
1305 max_debug_file_size=1000000
1306
1307
1308
1309 # Should we allow hostgroups to have no hosts, we default this to off since
1310 # that was the old behavior
1311
1312 allow_empty_hostgroup_assignment=0
1313
1314
1315
1316 # Normally worker count is dynamically allocated based on 1.5 * number of cpu's
1317 # with a minimum of 4 workers. This value will override the defaults
1318
1319 #check_workers=3
1320
1321
1322
1323 # DISABLE SERVICE CHECKS WHEN HOST DOWN
1324 # This option will disable all service checks if the host is not in an UP state
1325 #
1326 # While desirable in some environments, enabling this value can distort report
1327 # values as the expected quantity of checks will not have been performed
1328
1329 #host_down_disable_service_checks=0
1330
1331
1332
1333 # SET SERVICE/HOST STATUS WHEN SERVICE CHECK SKIPPED
1334 # These options will allow you to set the status of a service when its
1335 # service check is skipped due to one of three reasons:
1336 # 1) failed dependency check; 2) parent's status; 3) host not up
1337 # Number 3 can only happen if 'host_down_disable_service_checks' above
1338 # is set to 1.
1339 # Valid values for the service* options are:
1340 # -1 Do not change the service status (default - same as before 4.4)
1341 # 0 Set the service status to STATE_OK
1342 # 1 Set the service status to STATE_WARNING
1343 # 2 Set the service status to STATE_CRITICAL
1344 # 3 Set the service status to STATE_UNKNOWN
1345 # The host_dependency_skip_check_status option will allow you to set the
1346 # status of a host when itscheck is skipped due to a failed dependency check.
1347 # Valid values for the host_dependency_skip_check_status are:
1348 # -1 Do not change the service status (default - same as before 4.4)
1349 # 0 Set the host status to STATE_UP
1350 # 1 Set the host status to STATE_DOWN
1351 # 2 Set the host status to STATE_UNREACHABLE
1352 # We may add one or more statuses in the future.
1353
1354 #service_skip_check_dependency_status=-1
1355 #service_skip_check_parent_status=-1
1356 #service_skip_check_host_down_status=-1
1357 #host_skip_check_dependency_status=-1
1358
1359
1360
1361 # LOAD CONTROL OPTIONS
1362 # To get current defaults based on your system, issue this command to
1363 # the query handler:
1364 # echo -e '@core loadctl\0' | nc -U /usr/local/nagios/var/rw/nagios.qh
1365 #
1366 # Please note that used incorrectly these options can induce enormous latency.
1367 #
1368 # loadctl_options:
1369 # jobs_max The maximum amount of jobs to run at one time
1370 # jobs_min The minimum amount of jobs to run at one time
1371 # jobs_limit The maximum amount of jobs the current load lets us run
1372 # backoff_limit The minimum backoff_change
1373 # backoff_change # of jobs to remove from jobs_limit when backing off
1374 # rampup_limit Minimum rampup_change
1375 # rampup_change # of jobs to add to jobs_limit when ramping up
1376
1377 #loadctl_options=jobs_max=100;backoff_limit=10;rampup_change=5
0 ##############################################################################
1 #
2 # NAGIOS.CFG - Sample Main Config File for Nagios @VERSION@
3 #
4 # Read the documentation for more information on this configuration
5 # file. I've provided some comments here, but things may not be so
6 # clear without further explanation.
7 #
8 #
9 ##############################################################################
10
11
12 # LOG FILE
13 # This is the main log file where service and host events are logged
14 # for historical purposes. This should be the first option specified
15 # in the config file!!!
16
17 log_file=@localstatedir@/nagios.log
18
19
20
21 # OBJECT CONFIGURATION FILE(S)
22 # These are the object configuration files in which you define hosts,
23 # host groups, contacts, contact groups, services, etc.
24 # You can split your object definitions across several config files
25 # if you wish (as shown below), or keep them all in a single config file.
26
27 # You can specify individual object config files as shown below:
28 cfg_file=@sysconfdir@/objects/commands.cfg
29 cfg_file=@sysconfdir@/objects/contacts.cfg
30 cfg_file=@sysconfdir@/objects/timeperiods.cfg
31 cfg_file=@sysconfdir@/objects/templates.cfg
32
33 # Definitions for monitoring the local (Linux) host
34 cfg_file=@sysconfdir@/objects/localhost.cfg
35
36 # Definitions for monitoring a Windows machine
37 #cfg_file=@sysconfdir@/objects/windows.cfg
38
39 # Definitions for monitoring a router/switch
40 #cfg_file=@sysconfdir@/objects/switch.cfg
41
42 # Definitions for monitoring a network printer
43 #cfg_file=@sysconfdir@/objects/printer.cfg
44
45
46 # You can also tell Nagios to process all config files (with a .cfg
47 # extension) in a particular directory by using the cfg_dir
48 # directive as shown below:
49
50 #cfg_dir=@sysconfdir@/servers
51 #cfg_dir=@sysconfdir@/printers
52 #cfg_dir=@sysconfdir@/switches
53 #cfg_dir=@sysconfdir@/routers
54
55
56
57
58 # OBJECT CACHE FILE
59 # This option determines where object definitions are cached when
60 # Nagios starts/restarts. The CGIs read object definitions from
61 # this cache file (rather than looking at the object config files
62 # directly) in order to prevent inconsistencies that can occur
63 # when the config files are modified after Nagios starts.
64
65 object_cache_file=@localstatedir@/objects.cache
66
67
68
69 # PRE-CACHED OBJECT FILE
70 # This options determines the location of the precached object file.
71 # If you run Nagios with the -p command line option, it will preprocess
72 # your object configuration file(s) and write the cached config to this
73 # file. You can then start Nagios with the -u option to have it read
74 # object definitions from this precached file, rather than the standard
75 # object configuration files (see the cfg_file and cfg_dir options above).
76 # Using a precached object file can speed up the time needed to (re)start
77 # the Nagios process if you've got a large and/or complex configuration.
78 # Read the documentation section on optimizing Nagios to find our more
79 # about how this feature works.
80
81 precached_object_file=@localstatedir@/objects.precache
82
83
84
85 # RESOURCE FILE
86 # This is an optional resource file that contains $USERx$ macro
87 # definitions. Multiple resource files can be specified by using
88 # multiple resource_file definitions. The CGIs will not attempt to
89 # read the contents of resource files, so information that is
90 # considered to be sensitive (usernames, passwords, etc) can be
91 # defined as macros in this file and restrictive permissions (600)
92 # can be placed on this file.
93
94 resource_file=@sysconfdir@/resource.cfg
95
96
97
98 # STATUS FILE
99 # This is where the current status of all monitored services and
100 # hosts is stored. Its contents are read and processed by the CGIs.
101 # The contents of the status file are deleted every time Nagios
102 # restarts.
103
104 status_file=@localstatedir@/status.dat
105
106
107
108 # STATUS FILE UPDATE INTERVAL
109 # This option determines the frequency (in seconds) that
110 # Nagios will periodically dump program, host, and
111 # service status data.
112
113 status_update_interval=10
114
115
116
117 # NAGIOS USER
118 # This determines the effective user that Nagios should run as.
119 # You can either supply a username or a UID.
120
121 nagios_user=@nagios_user@
122
123
124
125 # NAGIOS GROUP
126 # This determines the effective group that Nagios should run as.
127 # You can either supply a group name or a GID.
128
129 nagios_group=@nagios_grp@
130
131
132
133 # EXTERNAL COMMAND OPTION
134 # This option allows you to specify whether or not Nagios should check
135 # for external commands (in the command file defined below).
136 # By default Nagios will check for external commands.
137 # If you want to be able to use the CGI command interface
138 # you will have to enable this.
139 # Values: 0 = disable commands, 1 = enable commands
140
141 check_external_commands=1
142
143
144
145 # EXTERNAL COMMAND FILE
146 # This is the file that Nagios checks for external command requests.
147 # It is also where the command CGI will write commands that are submitted
148 # by users, so it must be writeable by the user that the web server
149 # is running as (usually 'nobody'). Permissions should be set at the
150 # directory level instead of on the file, as the file is deleted every
151 # time its contents are processed.
152
153 command_file=@localstatedir@/rw/nagios.cmd
154
155
156
157 # QUERY HANDLER INTERFACE
158 # This is the socket that is created for the Query Handler interface
159
160 #query_socket=@localstatedir@/rw/nagios.qh
161
162
163
164 # LOCK FILE
165 # This is the lockfile that Nagios will use to store its PID number
166 # in when it is running in daemon mode.
167
168 lock_file=@subsyslockfile@
169
170
171
172 # TEMP FILE
173 # This is a temporary file that is used as scratch space when Nagios
174 # updates the status log, cleans the comment file, etc. This file
175 # is created, used, and deleted throughout the time that Nagios is
176 # running.
177
178 temp_file=@localstatedir@/nagios.tmp
179
180
181
182 # TEMP PATH
183 # This is path where Nagios can create temp files for service and
184 # host check results, etc.
185
186 temp_path=@TMPDIR@
187
188
189
190 # EVENT BROKER OPTIONS
191 # Controls what (if any) data gets sent to the event broker.
192 # Values: 0 = Broker nothing
193 # -1 = Broker everything
194 # <other> = See documentation
195
196 event_broker_options=-1
197
198
199
200 # EVENT BROKER MODULE(S)
201 # This directive is used to specify an event broker module that should
202 # by loaded by Nagios at startup. Use multiple directives if you want
203 # to load more than one module. Arguments that should be passed to
204 # the module at startup are separated from the module path by a space.
205 #
206 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
207 # WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING
208 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
209 #
210 # Do NOT overwrite modules while they are being used by Nagios or Nagios
211 # will crash in a fiery display of SEGFAULT glory. This is a bug/limitation
212 # either in dlopen(), the kernel, and/or the filesystem. And maybe Nagios...
213 #
214 # The correct/safe way of updating a module is by using one of these methods:
215 # 1. Shutdown Nagios, replace the module file, restart Nagios
216 # 2. Delete the original module file, move the new module file into place,
217 # restart Nagios
218 #
219 # Example:
220 #
221 # broker_module=<modulepath> [moduleargs]
222
223 #broker_module=/somewhere/module1.o
224 #broker_module=/somewhere/module2.o arg1 arg2=3 debug=0
225
226
227
228 # LOG ROTATION METHOD
229 # This is the log rotation method that Nagios should use to rotate
230 # the main log file. Values are as follows..
231 # n = None - don't rotate the log
232 # h = Hourly rotation (top of the hour)
233 # d = Daily rotation (midnight every day)
234 # w = Weekly rotation (midnight on Saturday evening)
235 # m = Monthly rotation (midnight last day of month)
236
237 log_rotation_method=d
238
239
240
241 # LOG ARCHIVE PATH
242 # This is the directory where archived (rotated) log files should be
243 # placed (assuming you've chosen to do log rotation).
244
245 log_archive_path=@localstatedir@/archives
246
247
248
249 # LOGGING OPTIONS
250 # If you want messages logged to the syslog facility, as well as the
251 # Nagios log file set this option to 1. If not, set it to 0.
252
253 use_syslog=1
254
255
256
257 # NOTIFICATION LOGGING OPTION
258 # If you don't want notifications to be logged, set this value to 0.
259 # If notifications should be logged, set the value to 1.
260
261 log_notifications=1
262
263
264
265 # SERVICE RETRY LOGGING OPTION
266 # If you don't want service check retries to be logged, set this value
267 # to 0. If retries should be logged, set the value to 1.
268
269 log_service_retries=1
270
271
272
273 # HOST RETRY LOGGING OPTION
274 # If you don't want host check retries to be logged, set this value to
275 # 0. If retries should be logged, set the value to 1.
276
277 log_host_retries=1
278
279
280
281 # EVENT HANDLER LOGGING OPTION
282 # If you don't want host and service event handlers to be logged, set
283 # this value to 0. If event handlers should be logged, set the value
284 # to 1.
285
286 log_event_handlers=1
287
288
289
290 # INITIAL STATES LOGGING OPTION
291 # If you want Nagios to log all initial host and service states to
292 # the main log file (the first time the service or host is checked)
293 # you can enable this option by setting this value to 1. If you
294 # are not using an external application that does long term state
295 # statistics reporting, you do not need to enable this option. In
296 # this case, set the value to 0.
297
298 log_initial_states=0
299
300
301
302 # CURRENT STATES LOGGING OPTION
303 # If you don't want Nagios to log all current host and service states
304 # after log has been rotated to the main log file, you can disable this
305 # option by setting this value to 0. Default value is 1.
306
307 log_current_states=1
308
309
310
311 # EXTERNAL COMMANDS LOGGING OPTION
312 # If you don't want Nagios to log external commands, set this value
313 # to 0. If external commands should be logged, set this value to 1.
314 # Note: This option does not include logging of passive service
315 # checks - see the option below for controlling whether or not
316 # passive checks are logged.
317
318 log_external_commands=1
319
320
321
322 # PASSIVE CHECKS LOGGING OPTION
323 # If you don't want Nagios to log passive host and service checks, set
324 # this value to 0. If passive checks should be logged, set
325 # this value to 1.
326
327 log_passive_checks=1
328
329
330
331 # GLOBAL HOST AND SERVICE EVENT HANDLERS
332 # These options allow you to specify a host and service event handler
333 # command that is to be run for every host or service state change.
334 # The global event handler is executed immediately prior to the event
335 # handler that you have optionally specified in each host or
336 # service definition. The command argument is the short name of a
337 # command definition that you define in your host configuration file.
338 # Read the HTML docs for more information.
339
340 #global_host_event_handler=somecommand
341 #global_service_event_handler=somecommand
342
343
344
345 # SERVICE INTER-CHECK DELAY METHOD
346 # This is the method that Nagios should use when initially
347 # "spreading out" service checks when it starts monitoring. The
348 # default is to use smart delay calculation, which will try to
349 # space all service checks out evenly to minimize CPU load.
350 # Using the dumb setting will cause all checks to be scheduled
351 # at the same time (with no delay between them)! This is not a
352 # good thing for production, but is useful when testing the
353 # parallelization functionality.
354 # n = None - don't use any delay between checks
355 # d = Use a "dumb" delay of 1 second between checks
356 # s = Use "smart" inter-check delay calculation
357 # x.xx = Use an inter-check delay of x.xx seconds
358
359 service_inter_check_delay_method=s
360
361
362
363 # MAXIMUM SERVICE CHECK SPREAD
364 # This variable determines the timeframe (in minutes) from the
365 # program start time that an initial check of all services should
366 # be completed. Default is 30 minutes.
367
368 max_service_check_spread=30
369
370
371
372 # SERVICE CHECK INTERLEAVE FACTOR
373 # This variable determines how service checks are interleaved.
374 # Interleaving the service checks allows for a more even
375 # distribution of service checks and reduced load on remote
376 # hosts. Setting this value to 1 is equivalent to how versions
377 # of Nagios previous to 0.0.5 did service checks. Set this
378 # value to s (smart) for automatic calculation of the interleave
379 # factor unless you have a specific reason to change it.
380 # s = Use "smart" interleave factor calculation
381 # x = Use an interleave factor of x, where x is a
382 # number greater than or equal to 1.
383
384 service_interleave_factor=s
385
386
387
388 # HOST INTER-CHECK DELAY METHOD
389 # This is the method that Nagios should use when initially
390 # "spreading out" host checks when it starts monitoring. The
391 # default is to use smart delay calculation, which will try to
392 # space all host checks out evenly to minimize CPU load.
393 # Using the dumb setting will cause all checks to be scheduled
394 # at the same time (with no delay between them)!
395 # n = None - don't use any delay between checks
396 # d = Use a "dumb" delay of 1 second between checks
397 # s = Use "smart" inter-check delay calculation
398 # x.xx = Use an inter-check delay of x.xx seconds
399
400 host_inter_check_delay_method=s
401
402
403
404 # MAXIMUM HOST CHECK SPREAD
405 # This variable determines the timeframe (in minutes) from the
406 # program start time that an initial check of all hosts should
407 # be completed. Default is 30 minutes.
408
409 max_host_check_spread=30
410
411
412
413 # MAXIMUM CONCURRENT SERVICE CHECKS
414 # This option allows you to specify the maximum number of
415 # service checks that can be run in parallel at any given time.
416 # Specifying a value of 1 for this variable essentially prevents
417 # any service checks from being parallelized. A value of 0
418 # will not restrict the number of concurrent checks that are
419 # being executed.
420
421 max_concurrent_checks=0
422
423
424
425 # HOST AND SERVICE CHECK REAPER FREQUENCY
426 # This is the frequency (in seconds!) that Nagios will process
427 # the results of host and service checks.
428
429 check_result_reaper_frequency=10
430
431
432
433
434 # MAX CHECK RESULT REAPER TIME
435 # This is the max amount of time (in seconds) that a single
436 # check result reaper event will be allowed to run before
437 # returning control back to Nagios so it can perform other
438 # duties.
439
440 max_check_result_reaper_time=30
441
442
443
444
445 # CHECK RESULT PATH
446 # This is directory where Nagios stores the results of host and
447 # service checks that have not yet been processed.
448 #
449 # Note: Make sure that only one instance of Nagios has access
450 # to this directory!
451
452 check_result_path=@CHECKRESULTDIR@
453
454
455
456
457 # MAX CHECK RESULT FILE AGE
458 # This option determines the maximum age (in seconds) which check
459 # result files are considered to be valid. Files older than this
460 # threshold will be mercilessly deleted without further processing.
461
462 max_check_result_file_age=3600
463
464
465
466
467 # CACHED HOST CHECK HORIZON
468 # This option determines the maximum amount of time (in seconds)
469 # that the state of a previous host check is considered current.
470 # Cached host states (from host checks that were performed more
471 # recently that the timeframe specified by this value) can immensely
472 # improve performance in regards to the host check logic.
473 # Too high of a value for this option may result in inaccurate host
474 # states being used by Nagios, while a lower value may result in a
475 # performance hit for host checks. Use a value of 0 to disable host
476 # check caching.
477
478 cached_host_check_horizon=15
479
480
481
482 # CACHED SERVICE CHECK HORIZON
483 # This option determines the maximum amount of time (in seconds)
484 # that the state of a previous service check is considered current.
485 # Cached service states (from service checks that were performed more
486 # recently that the timeframe specified by this value) can immensely
487 # improve performance in regards to predictive dependency checks.
488 # Use a value of 0 to disable service check caching.
489
490 cached_service_check_horizon=15
491
492
493
494 # ENABLE PREDICTIVE HOST DEPENDENCY CHECKS
495 # This option determines whether or not Nagios will attempt to execute
496 # checks of hosts when it predicts that future dependency logic test
497 # may be needed. These predictive checks can help ensure that your
498 # host dependency logic works well.
499 # Values:
500 # 0 = Disable predictive checks
501 # 1 = Enable predictive checks (default)
502
503 enable_predictive_host_dependency_checks=1
504
505
506
507 # ENABLE PREDICTIVE SERVICE DEPENDENCY CHECKS
508 # This option determines whether or not Nagios will attempt to execute
509 # checks of service when it predicts that future dependency logic test
510 # may be needed. These predictive checks can help ensure that your
511 # service dependency logic works well.
512 # Values:
513 # 0 = Disable predictive checks
514 # 1 = Enable predictive checks (default)
515
516 enable_predictive_service_dependency_checks=1
517
518
519
520 # SOFT STATE DEPENDENCIES
521 # This option determines whether or not Nagios will use soft state
522 # information when checking host and service dependencies. Normally
523 # Nagios will only use the latest hard host or service state when
524 # checking dependencies. If you want it to use the latest state (regardless
525 # of whether its a soft or hard state type), enable this option.
526 # Values:
527 # 0 = Don't use soft state dependencies (default)
528 # 1 = Use soft state dependencies
529
530 soft_state_dependencies=0
531
532
533
534 # TIME CHANGE ADJUSTMENT THRESHOLDS
535 # These options determine when Nagios will react to detected changes
536 # in system time (either forward or backwards).
537
538 #time_change_threshold=900
539
540
541
542 # AUTO-RESCHEDULING OPTION
543 # This option determines whether or not Nagios will attempt to
544 # automatically reschedule active host and service checks to
545 # "smooth" them out over time. This can help balance the load on
546 # the monitoring server.
547 # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
548 # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
549
550 auto_reschedule_checks=0
551
552
553
554 # AUTO-RESCHEDULING INTERVAL
555 # This option determines how often (in seconds) Nagios will
556 # attempt to automatically reschedule checks. This option only
557 # has an effect if the auto_reschedule_checks option is enabled.
558 # Default is 30 seconds.
559 # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
560 # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
561
562 auto_rescheduling_interval=30
563
564
565
566 # AUTO-RESCHEDULING WINDOW
567 # This option determines the "window" of time (in seconds) that
568 # Nagios will look at when automatically rescheduling checks.
569 # Only host and service checks that occur in the next X seconds
570 # (determined by this variable) will be rescheduled. This option
571 # only has an effect if the auto_reschedule_checks option is
572 # enabled. Default is 180 seconds (3 minutes).
573 # WARNING: THIS IS AN EXPERIMENTAL FEATURE - IT CAN DEGRADE
574 # PERFORMANCE, RATHER THAN INCREASE IT, IF USED IMPROPERLY
575
576 auto_rescheduling_window=180
577
578
579
580 # TIMEOUT VALUES
581 # These options control how much time Nagios will allow various
582 # types of commands to execute before killing them off. Options
583 # are available for controlling maximum time allotted for
584 # service checks, host checks, event handlers, notifications, the
585 # ocsp command, and performance data commands. All values are in
586 # seconds.
587
588 service_check_timeout=60
589 host_check_timeout=30
590 event_handler_timeout=30
591 notification_timeout=30
592 ocsp_timeout=5
593 ochp_timeout=5
594 perfdata_timeout=5
595
596
597
598 # RETAIN STATE INFORMATION
599 # This setting determines whether or not Nagios will save state
600 # information for services and hosts before it shuts down. Upon
601 # startup Nagios will reload all saved service and host state
602 # information before starting to monitor. This is useful for
603 # maintaining long-term data on state statistics, etc, but will
604 # slow Nagios down a bit when it (re)starts. Since its only
605 # a one-time penalty, I think its well worth the additional
606 # startup delay.
607
608 retain_state_information=1
609
610
611
612 # STATE RETENTION FILE
613 # This is the file that Nagios should use to store host and
614 # service state information before it shuts down. The state
615 # information in this file is also read immediately prior to
616 # starting to monitor the network when Nagios is restarted.
617 # This file is used only if the retain_state_information
618 # variable is set to 1.
619
620 state_retention_file=@localstatedir@/retention.dat
621
622
623
624 # RETENTION DATA UPDATE INTERVAL
625 # This setting determines how often (in minutes) that Nagios
626 # will automatically save retention data during normal operation.
627 # If you set this value to 0, Nagios will not save retention
628 # data at regular interval, but it will still save retention
629 # data before shutting down or restarting. If you have disabled
630 # state retention, this option has no effect.
631
632 retention_update_interval=60
633
634
635
636 # USE RETAINED PROGRAM STATE
637 # This setting determines whether or not Nagios will set
638 # program status variables based on the values saved in the
639 # retention file. If you want to use retained program status
640 # information, set this value to 1. If not, set this value
641 # to 0.
642
643 use_retained_program_state=1
644
645
646
647 # USE RETAINED SCHEDULING INFO
648 # This setting determines whether or not Nagios will retain
649 # the scheduling info (next check time) for hosts and services
650 # based on the values saved in the retention file. If you
651 # If you want to use retained scheduling info, set this
652 # value to 1. If not, set this value to 0.
653
654 use_retained_scheduling_info=1
655
656
657
658 # RETAINED ATTRIBUTE MASKS (ADVANCED FEATURE)
659 # The following variables are used to specify specific host and
660 # service attributes that should *not* be retained by Nagios during
661 # program restarts.
662 #
663 # The values of the masks are bitwise ANDs of values specified
664 # by the "MODATTR_" definitions found in include/common.h.
665 # For example, if you do not want the current enabled/disabled state
666 # of flap detection and event handlers for hosts to be retained, you
667 # would use a value of 24 for the host attribute mask...
668 # MODATTR_EVENT_HANDLER_ENABLED (8) + MODATTR_FLAP_DETECTION_ENABLED (16) = 24
669
670 # This mask determines what host attributes are not retained
671 retained_host_attribute_mask=0
672
673 # This mask determines what service attributes are not retained
674 retained_service_attribute_mask=0
675
676 # These two masks determine what process attributes are not retained.
677 # There are two masks, because some process attributes have host and service
678 # options. For example, you can disable active host checks, but leave active
679 # service checks enabled.
680 retained_process_host_attribute_mask=0
681 retained_process_service_attribute_mask=0
682
683 # These two masks determine what contact attributes are not retained.
684 # There are two masks, because some contact attributes have host and
685 # service options. For example, you can disable host notifications for
686 # a contact, but leave service notifications enabled for them.
687 retained_contact_host_attribute_mask=0
688 retained_contact_service_attribute_mask=0
689
690
691
692 # INTERVAL LENGTH
693 # This is the seconds per unit interval as used in the
694 # host/contact/service configuration files. Setting this to 60 means
695 # that each interval is one minute long (60 seconds). Other settings
696 # have not been tested much, so your mileage is likely to vary...
697
698 interval_length=60
699
700
701
702 # CHECK FOR UPDATES
703 # This option determines whether Nagios will automatically check to
704 # see if new updates (releases) are available. It is recommend that you
705 # enable this option to ensure that you stay on top of the latest critical
706 # patches to Nagios. Nagios is critical to you - make sure you keep it in
707 # good shape. Nagios will check once a day for new updates. Data collected
708 # by Nagios Enterprises from the update check is processed in accordance
709 # with our privacy policy - see https://api.nagios.org for details.
710
711 check_for_updates=1
712
713
714
715 # BARE UPDATE CHECK
716 # This option determines what data Nagios will send to api.nagios.org when
717 # it checks for updates. By default, Nagios will send information on the
718 # current version of Nagios you have installed, as well as an indicator as
719 # to whether this was a new installation or not. Nagios Enterprises uses
720 # this data to determine the number of users running specific version of
721 # Nagios. Enable this option if you do not want this information to be sent.
722
723 bare_update_check=0
724
725
726
727 # AGGRESSIVE HOST CHECKING OPTION
728 # If you don't want to turn on aggressive host checking features, set
729 # this value to 0 (the default). Otherwise set this value to 1 to
730 # enable the aggressive check option. Read the docs for more info
731 # on what aggressive host check is or check out the source code in
732 # base/checks.c
733
734 use_aggressive_host_checking=0
735
736
737
738 # SERVICE CHECK EXECUTION OPTION
739 # This determines whether or not Nagios will actively execute
740 # service checks when it initially starts. If this option is
741 # disabled, checks are not actively made, but Nagios can still
742 # receive and process passive check results that come in. Unless
743 # you're implementing redundant hosts or have a special need for
744 # disabling the execution of service checks, leave this enabled!
745 # Values: 1 = enable checks, 0 = disable checks
746
747 execute_service_checks=1
748
749
750
751 # PASSIVE SERVICE CHECK ACCEPTANCE OPTION
752 # This determines whether or not Nagios will accept passive
753 # service checks results when it initially (re)starts.
754 # Values: 1 = accept passive checks, 0 = reject passive checks
755
756 accept_passive_service_checks=1
757
758
759
760 # HOST CHECK EXECUTION OPTION
761 # This determines whether or not Nagios will actively execute
762 # host checks when it initially starts. If this option is
763 # disabled, checks are not actively made, but Nagios can still
764 # receive and process passive check results that come in. Unless
765 # you're implementing redundant hosts or have a special need for
766 # disabling the execution of host checks, leave this enabled!
767 # Values: 1 = enable checks, 0 = disable checks
768
769 execute_host_checks=1
770
771
772
773 # PASSIVE HOST CHECK ACCEPTANCE OPTION
774 # This determines whether or not Nagios will accept passive
775 # host checks results when it initially (re)starts.
776 # Values: 1 = accept passive checks, 0 = reject passive checks
777
778 accept_passive_host_checks=1
779
780
781
782 # NOTIFICATIONS OPTION
783 # This determines whether or not Nagios will sent out any host or
784 # service notifications when it is initially (re)started.
785 # Values: 1 = enable notifications, 0 = disable notifications
786
787 enable_notifications=1
788
789
790
791 # EVENT HANDLER USE OPTION
792 # This determines whether or not Nagios will run any host or
793 # service event handlers when it is initially (re)started. Unless
794 # you're implementing redundant hosts, leave this option enabled.
795 # Values: 1 = enable event handlers, 0 = disable event handlers
796
797 enable_event_handlers=1
798
799
800
801 # PROCESS PERFORMANCE DATA OPTION
802 # This determines whether or not Nagios will process performance
803 # data returned from service and host checks. If this option is
804 # enabled, host performance data will be processed using the
805 # host_perfdata_command (defined below) and service performance
806 # data will be processed using the service_perfdata_command (also
807 # defined below). Read the HTML docs for more information on
808 # performance data.
809 # Values: 1 = process performance data, 0 = do not process performance data
810
811 process_performance_data=0
812
813
814
815 # HOST AND SERVICE PERFORMANCE DATA PROCESSING COMMANDS
816 # These commands are run after every host and service check is
817 # performed. These commands are executed only if the
818 # enable_performance_data option (above) is set to 1. The command
819 # argument is the short name of a command definition that you
820 # define in your host configuration file. Read the HTML docs for
821 # more information on performance data.
822
823 #host_perfdata_command=process-host-perfdata
824 #service_perfdata_command=process-service-perfdata
825
826
827
828 # HOST AND SERVICE PERFORMANCE DATA FILES
829 # These files are used to store host and service performance data.
830 # Performance data is only written to these files if the
831 # enable_performance_data option (above) is set to 1.
832
833 #host_perfdata_file=@localstatedir@/host-perfdata
834 #service_perfdata_file=@localstatedir@/service-perfdata
835
836
837
838 # HOST AND SERVICE PERFORMANCE DATA FILE TEMPLATES
839 # These options determine what data is written (and how) to the
840 # performance data files. The templates may contain macros, special
841 # characters (\t for tab, \r for carriage return, \n for newline)
842 # and plain text. A newline is automatically added after each write
843 # to the performance data file. Some examples of what you can do are
844 # shown below.
845
846 #host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
847 #service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
848
849
850
851 # HOST AND SERVICE PERFORMANCE DATA FILE MODES
852 # This option determines whether or not the host and service
853 # performance data files are opened in write ("w") or append ("a")
854 # mode. If you want to use named pipes, you should use the special
855 # pipe ("p") mode which avoid blocking at startup, otherwise you will
856 # likely want the default append ("a") mode.
857
858 #host_perfdata_file_mode=a
859 #service_perfdata_file_mode=a
860
861
862
863 # HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING INTERVAL
864 # These options determine how often (in seconds) the host and service
865 # performance data files are processed using the commands defined
866 # below. A value of 0 indicates the files should not be periodically
867 # processed.
868
869 #host_perfdata_file_processing_interval=0
870 #service_perfdata_file_processing_interval=0
871
872
873
874 # HOST AND SERVICE PERFORMANCE DATA FILE PROCESSING COMMANDS
875 # These commands are used to periodically process the host and
876 # service performance data files. The interval at which the
877 # processing occurs is determined by the options above.
878
879 #host_perfdata_file_processing_command=process-host-perfdata-file
880 #service_perfdata_file_processing_command=process-service-perfdata-file
881
882
883
884 # HOST AND SERVICE PERFORMANCE DATA PROCESS EMPTY RESULTS
885 # These options determine whether the core will process empty perfdata
886 # results or not. This is needed for distributed monitoring, and intentionally
887 # turned on by default.
888 # If you don't require empty perfdata - saving some cpu cycles
889 # on unwanted macro calculation - you can turn that off. Be careful!
890 # Values: 1 = enable, 0 = disable
891
892 #host_perfdata_process_empty_results=1
893 #service_perfdata_process_empty_results=1
894
895
896 # OBSESS OVER SERVICE CHECKS OPTION
897 # This determines whether or not Nagios will obsess over service
898 # checks and run the ocsp_command defined below. Unless you're
899 # planning on implementing distributed monitoring, do not enable
900 # this option. Read the HTML docs for more information on
901 # implementing distributed monitoring.
902 # Values: 1 = obsess over services, 0 = do not obsess (default)
903
904 obsess_over_services=0
905
906
907
908 # OBSESSIVE COMPULSIVE SERVICE PROCESSOR COMMAND
909 # This is the command that is run for every service check that is
910 # processed by Nagios. This command is executed only if the
911 # obsess_over_services option (above) is set to 1. The command
912 # argument is the short name of a command definition that you
913 # define in your host configuration file. Read the HTML docs for
914 # more information on implementing distributed monitoring.
915
916 #ocsp_command=somecommand
917
918
919
920 # OBSESS OVER HOST CHECKS OPTION
921 # This determines whether or not Nagios will obsess over host
922 # checks and run the ochp_command defined below. Unless you're
923 # planning on implementing distributed monitoring, do not enable
924 # this option. Read the HTML docs for more information on
925 # implementing distributed monitoring.
926 # Values: 1 = obsess over hosts, 0 = do not obsess (default)
927
928 obsess_over_hosts=0
929
930
931
932 # OBSESSIVE COMPULSIVE HOST PROCESSOR COMMAND
933 # This is the command that is run for every host check that is
934 # processed by Nagios. This command is executed only if the
935 # obsess_over_hosts option (above) is set to 1. The command
936 # argument is the short name of a command definition that you
937 # define in your host configuration file. Read the HTML docs for
938 # more information on implementing distributed monitoring.
939
940 #ochp_command=somecommand
941
942
943
944 # TRANSLATE PASSIVE HOST CHECKS OPTION
945 # This determines whether or not Nagios will translate
946 # DOWN/UNREACHABLE passive host check results into their proper
947 # state for this instance of Nagios. This option is useful
948 # if you have distributed or failover monitoring setup. In
949 # these cases your other Nagios servers probably have a different
950 # "view" of the network, with regards to the parent/child relationship
951 # of hosts. If a distributed monitoring server thinks a host
952 # is DOWN, it may actually be UNREACHABLE from the point of
953 # this Nagios instance. Enabling this option will tell Nagios
954 # to translate any DOWN or UNREACHABLE host states it receives
955 # passively into the correct state from the view of this server.
956 # Values: 1 = perform translation, 0 = do not translate (default)
957
958 translate_passive_host_checks=0
959
960
961
962 # PASSIVE HOST CHECKS ARE SOFT OPTION
963 # This determines whether or not Nagios will treat passive host
964 # checks as being HARD or SOFT. By default, a passive host check
965 # result will put a host into a HARD state type. This can be changed
966 # by enabling this option.
967 # Values: 0 = passive checks are HARD, 1 = passive checks are SOFT
968
969 passive_host_checks_are_soft=0
970
971
972
973 # ORPHANED HOST/SERVICE CHECK OPTIONS
974 # These options determine whether or not Nagios will periodically
975 # check for orphaned host service checks. Since service checks are
976 # not rescheduled until the results of their previous execution
977 # instance are processed, there exists a possibility that some
978 # checks may never get rescheduled. A similar situation exists for
979 # host checks, although the exact scheduling details differ a bit
980 # from service checks. Orphaned checks seem to be a rare
981 # problem and should not happen under normal circumstances.
982 # If you have problems with service checks never getting
983 # rescheduled, make sure you have orphaned service checks enabled.
984 # Values: 1 = enable checks, 0 = disable checks
985
986 check_for_orphaned_services=1
987 check_for_orphaned_hosts=1
988
989
990
991 # SERVICE FRESHNESS CHECK OPTION
992 # This option determines whether or not Nagios will periodically
993 # check the "freshness" of service results. Enabling this option
994 # is useful for ensuring passive checks are received in a timely
995 # manner.
996 # Values: 1 = enabled freshness checking, 0 = disable freshness checking
997
998 check_service_freshness=1
999
1000
1001
1002 # SERVICE FRESHNESS CHECK INTERVAL
1003 # This setting determines how often (in seconds) Nagios will
1004 # check the "freshness" of service check results. If you have
1005 # disabled service freshness checking, this option has no effect.
1006
1007 service_freshness_check_interval=60
1008
1009
1010
1011 # SERVICE CHECK TIMEOUT STATE
1012 # This setting determines the state Nagios will report when a
1013 # service check times out - that is does not respond within
1014 # service_check_timeout seconds. This can be useful if a
1015 # machine is running at too high a load and you do not want
1016 # to consider a failed service check to be critical (the default).
1017 # Valid settings are:
1018 # c - Critical (default)
1019 # u - Unknown
1020 # w - Warning
1021 # o - OK
1022
1023 service_check_timeout_state=c
1024
1025
1026
1027 # HOST FRESHNESS CHECK OPTION
1028 # This option determines whether or not Nagios will periodically
1029 # check the "freshness" of host results. Enabling this option
1030 # is useful for ensuring passive checks are received in a timely
1031 # manner.
1032 # Values: 1 = enabled freshness checking, 0 = disable freshness checking
1033
1034 check_host_freshness=0
1035
1036
1037
1038 # HOST FRESHNESS CHECK INTERVAL
1039 # This setting determines how often (in seconds) Nagios will
1040 # check the "freshness" of host check results. If you have
1041 # disabled host freshness checking, this option has no effect.
1042
1043 host_freshness_check_interval=60
1044
1045
1046
1047
1048 # ADDITIONAL FRESHNESS THRESHOLD LATENCY
1049 # This setting determines the number of seconds that Nagios
1050 # will add to any host and service freshness thresholds that
1051 # it calculates (those not explicitly specified by the user).
1052
1053 additional_freshness_latency=15
1054
1055
1056
1057
1058 # FLAP DETECTION OPTION
1059 # This option determines whether or not Nagios will try
1060 # and detect hosts and services that are "flapping".
1061 # Flapping occurs when a host or service changes between
1062 # states too frequently. When Nagios detects that a
1063 # host or service is flapping, it will temporarily suppress
1064 # notifications for that host/service until it stops
1065 # flapping. Flap detection is very experimental, so read
1066 # the HTML documentation before enabling this feature!
1067 # Values: 1 = enable flap detection
1068 # 0 = disable flap detection (default)
1069
1070 enable_flap_detection=1
1071
1072
1073
1074 # FLAP DETECTION THRESHOLDS FOR HOSTS AND SERVICES
1075 # Read the HTML documentation on flap detection for
1076 # an explanation of what this option does. This option
1077 # has no effect if flap detection is disabled.
1078
1079 low_service_flap_threshold=5.0
1080 high_service_flap_threshold=20.0
1081 low_host_flap_threshold=5.0
1082 high_host_flap_threshold=20.0
1083
1084
1085
1086 # DATE FORMAT OPTION
1087 # This option determines how short dates are displayed. Valid options
1088 # include:
1089 # us (MM-DD-YYYY HH:MM:SS)
1090 # euro (DD-MM-YYYY HH:MM:SS)
1091 # iso8601 (YYYY-MM-DD HH:MM:SS)
1092 # strict-iso8601 (YYYY-MM-DDTHH:MM:SS)
1093 #
1094
1095 date_format=us
1096
1097
1098
1099
1100 # TIMEZONE OFFSET
1101 # This option is used to override the default timezone that this
1102 # instance of Nagios runs in. If not specified, Nagios will use
1103 # the system configured timezone.
1104 #
1105 # NOTE: In order to display the correct timezone in the CGIs, you
1106 # will also need to alter the Apache directives for the CGI path
1107 # to include your timezone. Example:
1108 #
1109 # <Directory "/usr/local/nagios/sbin/">
1110 # SetEnv TZ "Australia/Brisbane"
1111 # ...
1112 # </Directory>
1113
1114 #use_timezone=US/Mountain
1115 #use_timezone=Australia/Brisbane
1116
1117
1118
1119 # ILLEGAL OBJECT NAME CHARACTERS
1120 # This option allows you to specify illegal characters that cannot
1121 # be used in host names, service descriptions, or names of other
1122 # object types.
1123
1124 illegal_object_name_chars=`~!$%^&*|'"<>?,()=
1125
1126
1127
1128 # ILLEGAL MACRO OUTPUT CHARACTERS
1129 # This option allows you to specify illegal characters that are
1130 # stripped from macros before being used in notifications, event
1131 # handlers, etc. This DOES NOT affect macros used in service or
1132 # host check commands.
1133 # The following macros are stripped of the characters you specify:
1134 # $HOSTOUTPUT$
1135 # $LONGHOSTOUTPUT$
1136 # $HOSTPERFDATA$
1137 # $HOSTACKAUTHOR$
1138 # $HOSTACKCOMMENT$
1139 # $SERVICEOUTPUT$
1140 # $LONGSERVICEOUTPUT$
1141 # $SERVICEPERFDATA$
1142 # $SERVICEACKAUTHOR$
1143 # $SERVICEACKCOMMENT$
1144
1145 illegal_macro_output_chars=`~$&|'"<>
1146
1147
1148
1149 # REGULAR EXPRESSION MATCHING
1150 # This option controls whether or not regular expression matching
1151 # takes place in the object config files. Regular expression
1152 # matching is used to match host, hostgroup, service, and service
1153 # group names/descriptions in some fields of various object types.
1154 # Values: 1 = enable regexp matching, 0 = disable regexp matching
1155
1156 use_regexp_matching=0
1157
1158
1159
1160 # "TRUE" REGULAR EXPRESSION MATCHING
1161 # This option controls whether or not "true" regular expression
1162 # matching takes place in the object config files. This option
1163 # only has an effect if regular expression matching is enabled
1164 # (see above). If this option is DISABLED, regular expression
1165 # matching only occurs if a string contains wildcard characters
1166 # (* and ?). If the option is ENABLED, regexp matching occurs
1167 # all the time (which can be annoying).
1168 # Values: 1 = enable true matching, 0 = disable true matching
1169
1170 use_true_regexp_matching=0
1171
1172
1173
1174 # ADMINISTRATOR EMAIL/PAGER ADDRESSES
1175 # The email and pager address of a global administrator (likely you).
1176 # Nagios never uses these values itself, but you can access them by
1177 # using the $ADMINEMAIL$ and $ADMINPAGER$ macros in your notification
1178 # commands.
1179
1180 admin_email=@nagios_user@@localhost
1181 admin_pager=page@nagios_user@@localhost
1182
1183
1184
1185 # DAEMON CORE DUMP OPTION
1186 # This option determines whether or not Nagios is allowed to create
1187 # a core dump when it runs as a daemon. Note that it is generally
1188 # considered bad form to allow this, but it may be useful for
1189 # debugging purposes. Enabling this option doesn't guarantee that
1190 # a core file will be produced, but that's just life...
1191 # Values: 1 - Allow core dumps
1192 # 0 - Do not allow core dumps (default)
1193
1194 daemon_dumps_core=0
1195
1196
1197
1198 # LARGE INSTALLATION TWEAKS OPTION
1199 # This option determines whether or not Nagios will take some shortcuts
1200 # which can save on memory and CPU usage in large Nagios installations.
1201 # Read the documentation for more information on the benefits/tradeoffs
1202 # of enabling this option.
1203 # Values: 1 - Enabled tweaks
1204 # 0 - Disable tweaks (default)
1205
1206 use_large_installation_tweaks=0
1207
1208
1209
1210 # ENABLE ENVIRONMENT MACROS
1211 # This option determines whether or not Nagios will make all standard
1212 # macros available as environment variables when host/service checks
1213 # and system commands (event handlers, notifications, etc.) are
1214 # executed.
1215 # Enabling this is a very bad idea for anything but very small setups,
1216 # as it means plugins, notification scripts and eventhandlers may run
1217 # out of environment space. It will also cause a significant increase
1218 # in CPU- and memory usage and drastically reduce the number of checks
1219 # you can run.
1220 # Values: 1 - Enable environment variable macros
1221 # 0 - Disable environment variable macros (default)
1222
1223 enable_environment_macros=0
1224
1225
1226
1227 # CHILD PROCESS MEMORY OPTION
1228 # This option determines whether or not Nagios will free memory in
1229 # child processes (processed used to execute system commands and host/
1230 # service checks). If you specify a value here, it will override
1231 # program defaults.
1232 # Value: 1 - Free memory in child processes
1233 # 0 - Do not free memory in child processes
1234
1235 #free_child_process_memory=1
1236
1237
1238
1239 # CHILD PROCESS FORKING BEHAVIOR
1240 # This option determines how Nagios will fork child processes
1241 # (used to execute system commands and host/service checks). Normally
1242 # child processes are fork()ed twice, which provides a very high level
1243 # of isolation from problems. Fork()ing once is probably enough and will
1244 # save a great deal on CPU usage (in large installs), so you might
1245 # want to consider using this. If you specify a value here, it will
1246 # program defaults.
1247 # Value: 1 - Child processes fork() twice
1248 # 0 - Child processes fork() just once
1249
1250 #child_processes_fork_twice=1
1251
1252
1253
1254 # DEBUG LEVEL
1255 # This option determines how much (if any) debugging information will
1256 # be written to the debug file. OR values together to log multiple
1257 # types of information.
1258 # Values:
1259 # -1 = Everything
1260 # 0 = Nothing
1261 # 1 = Functions
1262 # 2 = Configuration
1263 # 4 = Process information
1264 # 8 = Scheduled events
1265 # 16 = Host/service checks
1266 # 32 = Notifications
1267 # 64 = Event broker
1268 # 128 = External commands
1269 # 256 = Commands
1270 # 512 = Scheduled downtime
1271 # 1024 = Comments
1272 # 2048 = Macros
1273 # 4096 = Interprocess communication
1274 # 8192 = Scheduling
1275 # 16384 = Workers
1276
1277 debug_level=0
1278
1279
1280
1281 # DEBUG VERBOSITY
1282 # This option determines how verbose the debug log out will be.
1283 # Values: 0 = Brief output
1284 # 1 = More detailed
1285 # 2 = Very detailed
1286
1287 debug_verbosity=1
1288
1289
1290
1291 # DEBUG FILE
1292 # This option determines where Nagios should write debugging information.
1293
1294 debug_file=@localstatedir@/nagios.debug
1295
1296
1297
1298 # MAX DEBUG FILE SIZE
1299 # This option determines the maximum size (in bytes) of the debug file. If
1300 # the file grows larger than this size, it will be renamed with a .old
1301 # extension. If a file already exists with a .old extension it will
1302 # automatically be deleted. This helps ensure your disk space usage doesn't
1303 # get out of control when debugging Nagios.
1304
1305 max_debug_file_size=1000000
1306
1307
1308
1309 # Should we allow hostgroups to have no hosts, we default this to off since
1310 # that was the old behavior
1311
1312 allow_empty_hostgroup_assignment=0
1313
1314
1315
1316 # Normally worker count is dynamically allocated based on 1.5 * number of cpu's
1317 # with a minimum of 4 workers. This value will override the defaults
1318
1319 #check_workers=3
1320
1321
1322
1323 # DISABLE SERVICE CHECKS WHEN HOST DOWN
1324 # This option will disable all service checks if the host is not in an UP state
1325 #
1326 # While desirable in some environments, enabling this value can distort report
1327 # values as the expected quantity of checks will not have been performed
1328
1329 #host_down_disable_service_checks=0
1330
1331
1332
1333 # SET SERVICE/HOST STATUS WHEN SERVICE CHECK SKIPPED
1334 # These options will allow you to set the status of a service when its
1335 # service check is skipped due to one of three reasons:
1336 # 1) failed dependency check; 2) parent's status; 3) host not up
1337 # Number 3 can only happen if 'host_down_disable_service_checks' above
1338 # is set to 1.
1339 # Valid values for the service* options are:
1340 # -1 Do not change the service status (default - same as before 4.4)
1341 # 0 Set the service status to STATE_OK
1342 # 1 Set the service status to STATE_WARNING
1343 # 2 Set the service status to STATE_CRITICAL
1344 # 3 Set the service status to STATE_UNKNOWN
1345 # The host_dependency_skip_check_status option will allow you to set the
1346 # status of a host when itscheck is skipped due to a failed dependency check.
1347 # Valid values for the host_dependency_skip_check_status are:
1348 # -1 Do not change the service status (default - same as before 4.4)
1349 # 0 Set the host status to STATE_UP
1350 # 1 Set the host status to STATE_DOWN
1351 # 2 Set the host status to STATE_UNREACHABLE
1352 # We may add one or more statuses in the future.
1353
1354 #service_skip_check_dependency_status=-1
1355 #service_skip_check_parent_status=-1
1356 #service_skip_check_host_down_status=-1
1357 #host_skip_check_dependency_status=-1
1358
1359
1360
1361 # LOAD CONTROL OPTIONS
1362 # To get current defaults based on your system, issue this command to
1363 # the query handler:
1364 # echo -e '@core loadctl\0' | nc -U /usr/local/nagios/var/rw/nagios.qh
1365 #
1366 # Please note that used incorrectly these options can induce enormous latency.
1367 #
1368 # loadctl_options:
1369 # jobs_max The maximum amount of jobs to run at one time
1370 # jobs_min The minimum amount of jobs to run at one time
1371 # jobs_limit The maximum amount of jobs the current load lets us run
1372 # backoff_limit The minimum backoff_change
1373 # backoff_change # of jobs to remove from jobs_limit when backing off
1374 # rampup_limit Minimum rampup_change
1375 # rampup_change # of jobs to add to jobs_limit when ramping up
1376
1377 #loadctl_options=jobs_max=100;backoff_limit=10;rampup_change=5
0 ###########################################################################
1 #
2 # RESOURCE.CFG - Sample Resource File for Nagios 4.4.3
3 #
4 #
5 # You can define $USERx$ macros in this file, which can in turn be used
6 # in command definitions in your host config file(s). $USERx$ macros are
7 # useful for storing sensitive information such as usernames, passwords,
8 # etc. They are also handy for specifying the path to plugins and
9 # event handlers - if you decide to move the plugins or event handlers to
10 # a different directory in the future, you can just update one or two
11 # $USERx$ macros, instead of modifying a lot of command definitions.
12 #
13 # The CGIs will not attempt to read the contents of resource files, so
14 # you can set restrictive permissions (600 or 660) on them.
15 #
16 # Nagios supports up to 256 $USERx$ macros ($USER1$ through $USER256$)
17 #
18 # Resource files may also be used to store configuration directives for
19 # external data sources like MySQL...
20 #
21 ###########################################################################
22
23 # Sets $USER1$ to be the path to the plugins
24 $USER1$=/usr/local/nagios/libexec
25
26 # Sets $USER2$ to be the path to event handlers
27 #$USER2$=/usr/local/nagios/libexec/eventhandlers
28
29 # Store some usernames and passwords (hidden from the CGIs)
30 #$USER3$=someuser
31 #$USER4$=somepassword
32
0 ###########################################################################
1 #
2 # RESOURCE.CFG - Sample Resource File for Nagios @VERSION@
3 #
4 #
5 # You can define $USERx$ macros in this file, which can in turn be used
6 # in command definitions in your host config file(s). $USERx$ macros are
7 # useful for storing sensitive information such as usernames, passwords,
8 # etc. They are also handy for specifying the path to plugins and
9 # event handlers - if you decide to move the plugins or event handlers to
10 # a different directory in the future, you can just update one or two
11 # $USERx$ macros, instead of modifying a lot of command definitions.
12 #
13 # The CGIs will not attempt to read the contents of resource files, so
14 # you can set restrictive permissions (600 or 660) on them.
15 #
16 # Nagios supports up to 256 $USERx$ macros ($USER1$ through $USER256$)
17 #
18 # Resource files may also be used to store configuration directives for
19 # external data sources like MySQL...
20 #
21 ###########################################################################
22
23 # Sets $USER1$ to be the path to the plugins
24 $USER1$=@libexecdir@
25
26 # Sets $USER2$ to be the path to event handlers
27 #$USER2$=@libexecdir@/eventhandlers
28
29 # Store some usernames and passwords (hidden from the CGIs)
30 #$USER3$=someuser
31 #$USER4$=somepassword
32
0 ================================
1 SAMPLE OBJECT CONFIG FILE README
2 ================================
3
4 This directory contains sample object definition config files.
5 Sample config files have a .cfg extension. Ignore any files with
6 a .in extension, as they are templates used to generate the sample
7 config files.
8
9 Please note that you can keep all of your object definitions in a
10 single file if you wish. You may also split them up into multiple
11 config files, as is done here.
12
13 Read the 'Quickstart Installation Guide' in the HTML documentation
14 for instructions on how to install and use these sample config files.
15
0 ###############################################################################
1 # COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 4.4.3
2 #
3 #
4 # NOTES: This config file provides you with some example command definitions
5 # that you can reference in host, service, and contact definitions.
6 #
7 # You don't need to keep commands in a separate file from your other
8 # object definitions. This has been done just to make things easier to
9 # understand.
10 #
11 ###############################################################################
12
13
14
15 ################################################################################
16 #
17 # SAMPLE NOTIFICATION COMMANDS
18 #
19 # These are some example notification commands. They may or may not work on
20 # your system without modification. As an example, some systems will require
21 # you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
22 #
23 ################################################################################
24
25 define command {
26
27 command_name notify-host-by-email
28 command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
29 }
30
31
32
33 define command {
34
35 command_name notify-service-by-email
36 command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
37 }
38
39
40
41 ################################################################################
42 #
43 # SAMPLE HOST CHECK COMMANDS
44 #
45 ################################################################################
46
47 # This command checks to see if a host is "alive" by pinging it
48 # The check must result in a 100% packet loss or 5 second (5000ms) round trip
49 # average time to produce a critical error.
50 # Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)
51
52 define command {
53
54 command_name check-host-alive
55 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
56 }
57
58
59
60 ################################################################################
61 #
62 # SAMPLE SERVICE CHECK COMMANDS
63 #
64 # These are some example service check commands. They may or may not work on
65 # your system, as they must be modified for your plugins. See the HTML
66 # documentation on the plugins for examples of how to configure command definitions.
67 #
68 # NOTE: The following 'check_local_...' functions are designed to monitor
69 # various metrics on the host that Nagios is running on (i.e. this one).
70 ################################################################################
71
72 define command {
73
74 command_name check_local_disk
75 command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
76 }
77
78
79
80 define command {
81
82 command_name check_local_load
83 command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
84 }
85
86
87
88 define command {
89
90 command_name check_local_procs
91 command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
92 }
93
94
95
96 define command {
97
98 command_name check_local_users
99 command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
100 }
101
102
103
104 define command {
105
106 command_name check_local_swap
107 command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
108 }
109
110
111
112 define command {
113
114 command_name check_local_mrtgtraf
115 command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
116 }
117
118
119
120 ################################################################################
121 # NOTE: The following 'check_...' commands are used to monitor services on
122 # both local and remote hosts.
123 ################################################################################
124
125 define command {
126
127 command_name check_ftp
128 command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
129 }
130
131
132
133 define command {
134
135 command_name check_hpjd
136 command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
137 }
138
139
140
141 define command {
142
143 command_name check_snmp
144 command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
145 }
146
147
148
149 define command {
150
151 command_name check_http
152 command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
153 }
154
155
156
157 define command {
158
159 command_name check_ssh
160 command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
161 }
162
163
164
165 define command {
166
167 command_name check_dhcp
168 command_line $USER1$/check_dhcp $ARG1$
169 }
170
171
172
173 define command {
174
175 command_name check_ping
176 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
177 }
178
179
180
181 define command {
182
183 command_name check_pop
184 command_line $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
185 }
186
187
188
189 define command {
190
191 command_name check_imap
192 command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
193 }
194
195
196
197 define command {
198
199 command_name check_smtp
200 command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
201 }
202
203
204
205 define command {
206
207 command_name check_tcp
208 command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
209 }
210
211
212
213 define command {
214
215 command_name check_udp
216 command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
217 }
218
219
220
221 define command {
222
223 command_name check_nt
224 command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
225 }
226
227
228
229 ################################################################################
230 #
231 # SAMPLE PERFORMANCE DATA COMMANDS
232 #
233 # These are sample performance data commands that can be used to send performance
234 # data output to two text files (one for hosts, another for services). If you
235 # plan on simply writing performance data out to a file, consider using the
236 # host_perfdata_file and service_perfdata_file options in the main config file.
237 #
238 ################################################################################
239
240 define command {
241
242 command_name process-host-perfdata
243 command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out
244 }
245
246
247
248 define command {
249
250 command_name process-service-perfdata
251 command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out
252 }
0 ###############################################################################
1 # COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS @VERSION@
2 #
3 #
4 # NOTES: This config file provides you with some example command definitions
5 # that you can reference in host, service, and contact definitions.
6 #
7 # You don't need to keep commands in a separate file from your other
8 # object definitions. This has been done just to make things easier to
9 # understand.
10 #
11 ###############################################################################
12
13
14
15 ################################################################################
16 #
17 # SAMPLE NOTIFICATION COMMANDS
18 #
19 # These are some example notification commands. They may or may not work on
20 # your system without modification. As an example, some systems will require
21 # you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
22 #
23 ################################################################################
24
25 define command {
26
27 command_name notify-host-by-email
28 command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
29 }
30
31
32
33 define command {
34
35 command_name notify-service-by-email
36 command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
37 }
38
39
40
41 ################################################################################
42 #
43 # SAMPLE HOST CHECK COMMANDS
44 #
45 ################################################################################
46
47 # This command checks to see if a host is "alive" by pinging it
48 # The check must result in a 100% packet loss or 5 second (5000ms) round trip
49 # average time to produce a critical error.
50 # Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)
51
52 define command {
53
54 command_name check-host-alive
55 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
56 }
57
58
59
60 ################################################################################
61 #
62 # SAMPLE SERVICE CHECK COMMANDS
63 #
64 # These are some example service check commands. They may or may not work on
65 # your system, as they must be modified for your plugins. See the HTML
66 # documentation on the plugins for examples of how to configure command definitions.
67 #
68 # NOTE: The following 'check_local_...' functions are designed to monitor
69 # various metrics on the host that Nagios is running on (i.e. this one).
70 ################################################################################
71
72 define command {
73
74 command_name check_local_disk
75 command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
76 }
77
78
79
80 define command {
81
82 command_name check_local_load
83 command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
84 }
85
86
87
88 define command {
89
90 command_name check_local_procs
91 command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
92 }
93
94
95
96 define command {
97
98 command_name check_local_users
99 command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
100 }
101
102
103
104 define command {
105
106 command_name check_local_swap
107 command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
108 }
109
110
111
112 define command {
113
114 command_name check_local_mrtgtraf
115 command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
116 }
117
118
119
120 ################################################################################
121 # NOTE: The following 'check_...' commands are used to monitor services on
122 # both local and remote hosts.
123 ################################################################################
124
125 define command {
126
127 command_name check_ftp
128 command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
129 }
130
131
132
133 define command {
134
135 command_name check_hpjd
136 command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
137 }
138
139
140
141 define command {
142
143 command_name check_snmp
144 command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
145 }
146
147
148
149 define command {
150
151 command_name check_http
152 command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
153 }
154
155
156
157 define command {
158
159 command_name check_ssh
160 command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
161 }
162
163
164
165 define command {
166
167 command_name check_dhcp
168 command_line $USER1$/check_dhcp $ARG1$
169 }
170
171
172
173 define command {
174
175 command_name check_ping
176 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
177 }
178
179
180
181 define command {
182
183 command_name check_pop
184 command_line $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
185 }
186
187
188
189 define command {
190
191 command_name check_imap
192 command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
193 }
194
195
196
197 define command {
198
199 command_name check_smtp
200 command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
201 }
202
203
204
205 define command {
206
207 command_name check_tcp
208 command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
209 }
210
211
212
213 define command {
214
215 command_name check_udp
216 command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
217 }
218
219
220
221 define command {
222
223 command_name check_nt
224 command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
225 }
226
227
228
229 ################################################################################
230 #
231 # SAMPLE PERFORMANCE DATA COMMANDS
232 #
233 # These are sample performance data commands that can be used to send performance
234 # data output to two text files (one for hosts, another for services). If you
235 # plan on simply writing performance data out to a file, consider using the
236 # host_perfdata_file and service_perfdata_file options in the main config file.
237 #
238 ################################################################################
239
240 define command {
241
242 command_name process-host-perfdata
243 command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> @localstatedir@/host-perfdata.out
244 }
245
246
247
248 define command {
249
250 command_name process-service-perfdata
251 command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> @localstatedir@/service-perfdata.out
252 }
0 ###############################################################################
1 # CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS
2 #
3 #
4 # NOTES: This config file provides you with some example contact and contact
5 # group definitions that you can reference in host and service
6 # definitions.
7 #
8 # You don't need to keep these definitions in a separate file from your
9 # other object definitions. This has been done just to make things
10 # easier to understand.
11 #
12 ###############################################################################
13
14
15
16 ###############################################################################
17 #
18 # CONTACTS
19 #
20 ###############################################################################
21
22 # Just one contact defined by default - the Nagios admin (that's you)
23 # This contact definition inherits a lot of default values from the
24 # 'generic-contact' template which is defined elsewhere.
25
26 define contact {
27
28 contact_name nagiosadmin ; Short name of user
29 use generic-contact ; Inherit default values from generic-contact template (defined above)
30 alias Nagios Admin ; Full name of user
31 email nagios@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
32 }
33
34
35
36 ###############################################################################
37 #
38 # CONTACT GROUPS
39 #
40 ###############################################################################
41
42 # We only have one contact in this simple configuration file, so there is
43 # no need to create more than one contact group.
44
45 define contactgroup {
46
47 contactgroup_name admins
48 alias Nagios Administrators
49 members nagiosadmin
50 }
0 ###############################################################################
1 # CONTACTS.CFG - SAMPLE CONTACT/CONTACTGROUP DEFINITIONS
2 #
3 #
4 # NOTES: This config file provides you with some example contact and contact
5 # group definitions that you can reference in host and service
6 # definitions.
7 #
8 # You don't need to keep these definitions in a separate file from your
9 # other object definitions. This has been done just to make things
10 # easier to understand.
11 #
12 ###############################################################################
13
14
15
16 ###############################################################################
17 #
18 # CONTACTS
19 #
20 ###############################################################################
21
22 # Just one contact defined by default - the Nagios admin (that's you)
23 # This contact definition inherits a lot of default values from the
24 # 'generic-contact' template which is defined elsewhere.
25
26 define contact {
27
28 contact_name nagiosadmin ; Short name of user
29 use generic-contact ; Inherit default values from generic-contact template (defined above)
30 alias Nagios Admin ; Full name of user
31 email @nagios_user@@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
32 }
33
34
35
36 ###############################################################################
37 #
38 # CONTACT GROUPS
39 #
40 ###############################################################################
41
42 # We only have one contact in this simple configuration file, so there is
43 # no need to create more than one contact group.
44
45 define contactgroup {
46
47 contactgroup_name admins
48 alias Nagios Administrators
49 members nagiosadmin
50 }
0 ###############################################################################
1 # LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
2 #
3 #
4 # NOTE: This config file is intended to serve as an *extremely* simple
5 # example of how you can create configuration entries to monitor
6 # the local (Linux) machine.
7 #
8 ###############################################################################
9
10
11
12 ###############################################################################
13 #
14 # HOST DEFINITION
15 #
16 ###############################################################################
17
18 # Define a host for the local machine
19
20 define host {
21
22 use linux-server ; Name of host template to use
23 ; This host definition will inherit all variables that are defined
24 ; in (or inherited by) the linux-server host template definition.
25 host_name localhost
26 alias localhost
27 address 127.0.0.1
28 }
29
30
31
32 ###############################################################################
33 #
34 # HOST GROUP DEFINITION
35 #
36 ###############################################################################
37
38 # Define an optional hostgroup for Linux machines
39
40 define hostgroup {
41
42 hostgroup_name linux-servers ; The name of the hostgroup
43 alias Linux Servers ; Long name of the group
44 members localhost ; Comma separated list of hosts that belong to this group
45 }
46
47
48
49 ###############################################################################
50 #
51 # SERVICE DEFINITIONS
52 #
53 ###############################################################################
54
55 # Define a service to "ping" the local machine
56
57 define service {
58
59 use local-service ; Name of service template to use
60 host_name localhost
61 service_description PING
62 check_command check_ping!100.0,20%!500.0,60%
63 }
64
65
66
67 # Define a service to check the disk space of the root partition
68 # on the local machine. Warning if < 20% free, critical if
69 # < 10% free space on partition.
70
71 define service {
72
73 use local-service ; Name of service template to use
74 host_name localhost
75 service_description Root Partition
76 check_command check_local_disk!20%!10%!/
77 }
78
79
80
81 # Define a service to check the number of currently logged in
82 # users on the local machine. Warning if > 20 users, critical
83 # if > 50 users.
84
85 define service {
86
87 use local-service ; Name of service template to use
88 host_name localhost
89 service_description Current Users
90 check_command check_local_users!20!50
91 }
92
93
94
95 # Define a service to check the number of currently running procs
96 # on the local machine. Warning if > 250 processes, critical if
97 # > 400 processes.
98
99 define service {
100
101 use local-service ; Name of service template to use
102 host_name localhost
103 service_description Total Processes
104 check_command check_local_procs!250!400!RSZDT
105 }
106
107
108
109 # Define a service to check the load on the local machine.
110
111 define service {
112
113 use local-service ; Name of service template to use
114 host_name localhost
115 service_description Current Load
116 check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
117 }
118
119
120
121 # Define a service to check the swap usage the local machine.
122 # Critical if less than 10% of swap is free, warning if less than 20% is free
123
124 define service {
125
126 use local-service ; Name of service template to use
127 host_name localhost
128 service_description Swap Usage
129 check_command check_local_swap!20%!10%
130 }
131
132
133
134 # Define a service to check SSH on the local machine.
135 # Disable notifications for this service by default, as not all users may have SSH enabled.
136
137 define service {
138
139 use local-service ; Name of service template to use
140 host_name localhost
141 service_description SSH
142 check_command check_ssh
143 notifications_enabled 0
144 }
145
146
147
148 # Define a service to check HTTP on the local machine.
149 # Disable notifications for this service by default, as not all users may have HTTP enabled.
150
151 define service {
152
153 use local-service ; Name of service template to use
154 host_name localhost
155 service_description HTTP
156 check_command check_http
157 notifications_enabled 0
158 }
0 ###############################################################################
1 # LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
2 #
3 #
4 # NOTE: This config file is intended to serve as an *extremely* simple
5 # example of how you can create configuration entries to monitor
6 # the local (Linux) machine.
7 #
8 ###############################################################################
9
10
11
12 ###############################################################################
13 #
14 # HOST DEFINITION
15 #
16 ###############################################################################
17
18 # Define a host for the local machine
19
20 define host {
21
22 use linux-server ; Name of host template to use
23 ; This host definition will inherit all variables that are defined
24 ; in (or inherited by) the linux-server host template definition.
25 host_name localhost
26 alias localhost
27 address 127.0.0.1
28 }
29
30
31
32 ###############################################################################
33 #
34 # HOST GROUP DEFINITION
35 #
36 ###############################################################################
37
38 # Define an optional hostgroup for Linux machines
39
40 define hostgroup {
41
42 hostgroup_name linux-servers ; The name of the hostgroup
43 alias Linux Servers ; Long name of the group
44 members localhost ; Comma separated list of hosts that belong to this group
45 }
46
47
48
49 ###############################################################################
50 #
51 # SERVICE DEFINITIONS
52 #
53 ###############################################################################
54
55 # Define a service to "ping" the local machine
56
57 define service {
58
59 use local-service ; Name of service template to use
60 host_name localhost
61 service_description PING
62 check_command check_ping!100.0,20%!500.0,60%
63 }
64
65
66
67 # Define a service to check the disk space of the root partition
68 # on the local machine. Warning if < 20% free, critical if
69 # < 10% free space on partition.
70
71 define service {
72
73 use local-service ; Name of service template to use
74 host_name localhost
75 service_description Root Partition
76 check_command check_local_disk!20%!10%!/
77 }
78
79
80
81 # Define a service to check the number of currently logged in
82 # users on the local machine. Warning if > 20 users, critical
83 # if > 50 users.
84
85 define service {
86
87 use local-service ; Name of service template to use
88 host_name localhost
89 service_description Current Users
90 check_command check_local_users!20!50
91 }
92
93
94
95 # Define a service to check the number of currently running procs
96 # on the local machine. Warning if > 250 processes, critical if
97 # > 400 processes.
98
99 define service {
100
101 use local-service ; Name of service template to use
102 host_name localhost
103 service_description Total Processes
104 check_command check_local_procs!250!400!RSZDT
105 }
106
107
108
109 # Define a service to check the load on the local machine.
110
111 define service {
112
113 use local-service ; Name of service template to use
114 host_name localhost
115 service_description Current Load
116 check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
117 }
118
119
120
121 # Define a service to check the swap usage the local machine.
122 # Critical if less than 10% of swap is free, warning if less than 20% is free
123
124 define service {
125
126 use local-service ; Name of service template to use
127 host_name localhost
128 service_description Swap Usage
129 check_command check_local_swap!20%!10%
130 }
131
132
133
134 # Define a service to check SSH on the local machine.
135 # Disable notifications for this service by default, as not all users may have SSH enabled.
136
137 define service {
138
139 use local-service ; Name of service template to use
140 host_name localhost
141 service_description SSH
142 check_command check_ssh
143 notifications_enabled 0
144 }
145
146
147
148 # Define a service to check HTTP on the local machine.
149 # Disable notifications for this service by default, as not all users may have HTTP enabled.
150
151 define service {
152
153 use local-service ; Name of service template to use
154 host_name localhost
155 service_description HTTP
156 check_command check_http
157 notifications_enabled 0
158 }
0 ###############################################################################
1 # PRINTER.CFG - SAMPLE CONFIG FILE FOR MONITORING A NETWORK PRINTER
2 #
3 #
4 # NOTES: This config file assumes that you are using the sample configuration
5 # files that get installed with the Nagios quickstart guide.
6 #
7 ###############################################################################
8
9
10
11 ###############################################################################
12 #
13 # HOST DEFINITIONS
14 #
15 ###############################################################################
16
17 # Define a host for the printer we'll be monitoring
18 # Change the host_name, alias, and address to fit your situation
19
20 define host {
21
22 use generic-printer ; Inherit default values from a template
23 host_name hplj2605dn ; The name we're giving to this printer
24 alias HP LaserJet 2605dn ; A longer name associated with the printer
25 address 192.168.1.30 ; IP address of the printer
26 hostgroups network-printers ; Host groups this printer is associated with
27 }
28
29
30
31 ###############################################################################
32 #
33 # HOST GROUP DEFINITIONS
34 #
35 ###############################################################################
36
37 # A hostgroup for network printers
38
39 define hostgroup {
40
41 hostgroup_name network-printers ; The name of the hostgroup
42 alias Network Printers ; Long name of the group
43 }
44
45
46
47 ###############################################################################
48 #
49 # SERVICE DEFINITIONS
50 #
51 ###############################################################################
52
53 # Create a service for monitoring the status of the printer
54 # Change the host_name to match the name of the host you defined above
55 # If the printer has an SNMP community string other than "public",
56 # change the check_command directive to reflect that
57
58 define service {
59
60 use generic-service ; Inherit values from a template
61 host_name hplj2605dn ; The name of the host the service is associated with
62 service_description Printer Status ; The service description
63 check_command check_hpjd!-C public ; The command used to monitor the service
64 check_interval 10 ; Check the service every 10 minutes under normal conditions
65 retry_interval 1 ; Re-check the service every minute until its final/hard state is determined
66 }
67
68
69
70 # Create a service for "pinging" the printer occasionally.
71 # Useful for monitoring RTA, packet loss, etc.
72
73 define service {
74
75 use generic-service
76 host_name hplj2605dn
77 service_description PING
78 check_command check_ping!3000.0,80%!5000.0,100%
79 check_interval 10
80 retry_interval 1
81 }
0 ###############################################################################
1 # PRINTER.CFG - SAMPLE CONFIG FILE FOR MONITORING A NETWORK PRINTER
2 #
3 #
4 # NOTES: This config file assumes that you are using the sample configuration
5 # files that get installed with the Nagios quickstart guide.
6 #
7 ###############################################################################
8
9
10
11 ###############################################################################
12 #
13 # HOST DEFINITIONS
14 #
15 ###############################################################################
16
17 # Define a host for the printer we'll be monitoring
18 # Change the host_name, alias, and address to fit your situation
19
20 define host {
21
22 use generic-printer ; Inherit default values from a template
23 host_name hplj2605dn ; The name we're giving to this printer
24 alias HP LaserJet 2605dn ; A longer name associated with the printer
25 address 192.168.1.30 ; IP address of the printer
26 hostgroups network-printers ; Host groups this printer is associated with
27 }
28
29
30
31 ###############################################################################
32 #
33 # HOST GROUP DEFINITIONS
34 #
35 ###############################################################################
36
37 # A hostgroup for network printers
38
39 define hostgroup {
40
41 hostgroup_name network-printers ; The name of the hostgroup
42 alias Network Printers ; Long name of the group
43 }
44
45
46
47 ###############################################################################
48 #
49 # SERVICE DEFINITIONS
50 #
51 ###############################################################################
52
53 # Create a service for monitoring the status of the printer
54 # Change the host_name to match the name of the host you defined above
55 # If the printer has an SNMP community string other than "public",
56 # change the check_command directive to reflect that
57
58 define service {
59
60 use generic-service ; Inherit values from a template
61 host_name hplj2605dn ; The name of the host the service is associated with
62 service_description Printer Status ; The service description
63 check_command check_hpjd!-C public ; The command used to monitor the service
64 check_interval 10 ; Check the service every 10 minutes under normal conditions
65 retry_interval 1 ; Re-check the service every minute until its final/hard state is determined
66 }
67
68
69
70 # Create a service for "pinging" the printer occasionally.
71 # Useful for monitoring RTA, packet loss, etc.
72
73 define service {
74
75 use generic-service
76 host_name hplj2605dn
77 service_description PING
78 check_command check_ping!3000.0,80%!5000.0,100%
79 check_interval 10
80 retry_interval 1
81 }
0 ###############################################################################
1 # SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH
2 #
3 #
4 # NOTES: This config file assumes that you are using the sample configuration
5 # files that get installed with the Nagios quickstart guide.
6 #
7 ###############################################################################
8
9
10
11 ###############################################################################
12 #
13 # HOST DEFINITIONS
14 #
15 ###############################################################################
16
17 # Define the switch that we'll be monitoring
18
19 define host {
20
21 use generic-switch ; Inherit default values from a template
22 host_name linksys-srw224p ; The name we're giving to this switch
23 alias Linksys SRW224P Switch ; A longer name associated with the switch
24 address 192.168.1.253 ; IP address of the switch
25 hostgroups switches ; Host groups this switch is associated with
26 }
27
28
29
30 ###############################################################################
31 #
32 # HOST GROUP DEFINITIONS
33 #
34 ###############################################################################
35
36 # Create a new hostgroup for switches
37
38 define hostgroup {
39
40 hostgroup_name switches ; The name of the hostgroup
41 alias Network Switches ; Long name of the group
42 }
43
44
45
46 ###############################################################################
47 #
48 # SERVICE DEFINITIONS
49 #
50 ###############################################################################
51
52 # Create a service to PING to switch
53
54 define service {
55
56 use generic-service ; Inherit values from a template
57 host_name linksys-srw224p ; The name of the host the service is associated with
58 service_description PING ; The service description
59 check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
60 check_interval 5 ; Check the service every 5 minutes under normal conditions
61 retry_interval 1 ; Re-check the service every minute until its final/hard state is determined
62 }
63
64
65
66 # Monitor uptime via SNMP
67
68 define service {
69
70 use generic-service ; Inherit values from a template
71 host_name linksys-srw224p
72 service_description Uptime
73 check_command check_snmp!-C public -o sysUpTime.0
74 }
75
76
77
78 # Monitor Port 1 status via SNMP
79
80 define service {
81
82 use generic-service ; Inherit values from a template
83 host_name linksys-srw224p
84 service_description Port 1 Link Status
85 check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
86 }
87
88
89
90 # Monitor bandwidth via MRTG logs
91
92 define service {
93
94 use generic-service ; Inherit values from a template
95 host_name linksys-srw224p
96 service_description Port 1 Bandwidth Usage
97 check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10
98 }
0 ###############################################################################
1 # SWITCH.CFG - SAMPLE CONFIG FILE FOR MONITORING A SWITCH
2 #
3 #
4 # NOTES: This config file assumes that you are using the sample configuration
5 # files that get installed with the Nagios quickstart guide.
6 #
7 ###############################################################################
8
9
10
11 ###############################################################################
12 #
13 # HOST DEFINITIONS
14 #
15 ###############################################################################
16
17 # Define the switch that we'll be monitoring
18
19 define host {
20
21 use generic-switch ; Inherit default values from a template
22 host_name linksys-srw224p ; The name we're giving to this switch
23 alias Linksys SRW224P Switch ; A longer name associated with the switch
24 address 192.168.1.253 ; IP address of the switch
25 hostgroups switches ; Host groups this switch is associated with
26 }
27
28
29
30 ###############################################################################
31 #
32 # HOST GROUP DEFINITIONS
33 #
34 ###############################################################################
35
36 # Create a new hostgroup for switches
37
38 define hostgroup {
39
40 hostgroup_name switches ; The name of the hostgroup
41 alias Network Switches ; Long name of the group
42 }
43
44
45
46 ###############################################################################
47 #
48 # SERVICE DEFINITIONS
49 #
50 ###############################################################################
51
52 # Create a service to PING to switch
53
54 define service {
55
56 use generic-service ; Inherit values from a template
57 host_name linksys-srw224p ; The name of the host the service is associated with
58 service_description PING ; The service description
59 check_command check_ping!200.0,20%!600.0,60% ; The command used to monitor the service
60 check_interval 5 ; Check the service every 5 minutes under normal conditions
61 retry_interval 1 ; Re-check the service every minute until its final/hard state is determined
62 }
63
64
65
66 # Monitor uptime via SNMP
67
68 define service {
69
70 use generic-service ; Inherit values from a template
71 host_name linksys-srw224p
72 service_description Uptime
73 check_command check_snmp!-C public -o sysUpTime.0
74 }
75
76
77
78 # Monitor Port 1 status via SNMP
79
80 define service {
81
82 use generic-service ; Inherit values from a template
83 host_name linksys-srw224p
84 service_description Port 1 Link Status
85 check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
86 }
87
88
89
90 # Monitor bandwidth via MRTG logs
91
92 define service {
93
94 use generic-service ; Inherit values from a template
95 host_name linksys-srw224p
96 service_description Port 1 Bandwidth Usage
97 check_command check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!1000000,1000000!5000000,5000000!10
98 }
0 ###############################################################################
1 # TEMPLATES.CFG - SAMPLE OBJECT TEMPLATES
2 #
3 #
4 # NOTES: This config file provides you with some example object definition
5 # templates that are referred by other host, service, contact, etc.
6 # definitions in other config files.
7 #
8 # You don't need to keep these definitions in a separate file from your
9 # other object definitions. This has been done just to make things
10 # easier to understand.
11 #
12 ###############################################################################
13
14
15
16 ###############################################################################
17 #
18 # CONTACT TEMPLATES
19 #
20 ###############################################################################
21
22 # Generic contact definition template
23 # This is NOT a real contact, just a template!
24
25 define contact {
26
27 name generic-contact ; The name of this contact template
28 service_notification_period 24x7 ; service notifications can be sent anytime
29 host_notification_period 24x7 ; host notifications can be sent anytime
30 service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
31 host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
32 service_notification_commands notify-service-by-email ; send service notifications via email
33 host_notification_commands notify-host-by-email ; send host notifications via email
34 register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
35 }
36
37
38
39 ###############################################################################
40 #
41 # HOST TEMPLATES
42 #
43 ###############################################################################
44
45 # Generic host definition template
46 # This is NOT a real host, just a template!
47
48 define host {
49
50 name generic-host ; The name of this host template
51 notifications_enabled 1 ; Host notifications are enabled
52 event_handler_enabled 1 ; Host event handler is enabled
53 flap_detection_enabled 1 ; Flap detection is enabled
54 process_perf_data 1 ; Process performance data
55 retain_status_information 1 ; Retain status information across program restarts
56 retain_nonstatus_information 1 ; Retain non-status information across program restarts
57 notification_period 24x7 ; Send host notifications at any time
58 register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
59 }
60
61
62
63 # Linux host definition template
64 # This is NOT a real host, just a template!
65
66 define host {
67
68 name linux-server ; The name of this host template
69 use generic-host ; This template inherits other values from the generic-host template
70 check_period 24x7 ; By default, Linux hosts are checked round the clock
71 check_interval 5 ; Actively check the host every 5 minutes
72 retry_interval 1 ; Schedule host check retries at 1 minute intervals
73 max_check_attempts 10 ; Check each Linux host 10 times (max)
74 check_command check-host-alive ; Default command to check Linux hosts
75 notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day
76 ; Note that the notification_period variable is being overridden from
77 ; the value that is inherited from the generic-host template!
78 notification_interval 120 ; Resend notifications every 2 hours
79 notification_options d,u,r ; Only send notifications for specific host states
80 contact_groups admins ; Notifications get sent to the admins by default
81 register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
82 }
83
84
85
86
87 # Windows host definition template
88 # This is NOT a real host, just a template!
89
90 define host {
91
92 name windows-server ; The name of this host template
93 use generic-host ; Inherit default values from the generic-host template
94 check_period 24x7 ; By default, Windows servers are monitored round the clock
95 check_interval 5 ; Actively check the server every 5 minutes
96 retry_interval 1 ; Schedule host check retries at 1 minute intervals
97 max_check_attempts 10 ; Check each server 10 times (max)
98 check_command check-host-alive ; Default command to check if servers are "alive"
99 notification_period 24x7 ; Send notification out at any time - day or night
100 notification_interval 30 ; Resend notifications every 30 minutes
101 notification_options d,r ; Only send notifications for specific host states
102 contact_groups admins ; Notifications get sent to the admins by default
103 hostgroups windows-servers ; Host groups that Windows servers should be a member of
104 register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
105 }
106
107
108
109 # We define a generic printer template that can
110 # be used for most printers we monitor
111
112 define host {
113
114 name generic-printer ; The name of this host template
115 use generic-host ; Inherit default values from the generic-host template
116 check_period 24x7 ; By default, printers are monitored round the clock
117 check_interval 5 ; Actively check the printer every 5 minutes
118 retry_interval 1 ; Schedule host check retries at 1 minute intervals
119 max_check_attempts 10 ; Check each printer 10 times (max)
120 check_command check-host-alive ; Default command to check if printers are "alive"
121 notification_period workhours ; Printers are only used during the workday
122 notification_interval 30 ; Resend notifications every 30 minutes
123 notification_options d,r ; Only send notifications for specific host states
124 contact_groups admins ; Notifications get sent to the admins by default
125 register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
126 }
127
128
129
130 # Define a template for switches that we can reuse
131 define host {
132
133 name generic-switch ; The name of this host template
134 use generic-host ; Inherit default values from the generic-host template
135 check_period 24x7 ; By default, switches are monitored round the clock
136 check_interval 5 ; Switches are checked every 5 minutes
137 retry_interval 1 ; Schedule host check retries at 1 minute intervals
138 max_check_attempts 10 ; Check each switch 10 times (max)
139 check_command check-host-alive ; Default command to check if routers are "alive"
140 notification_period 24x7 ; Send notifications at any time
141 notification_interval 30 ; Resend notifications every 30 minutes
142 notification_options d,r ; Only send notifications for specific host states
143 contact_groups admins ; Notifications get sent to the admins by default
144 register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
145 }
146
147
148
149 ###############################################################################
150 #
151 # SERVICE TEMPLATES
152 #
153 ###############################################################################
154
155 # Generic service definition template
156 # This is NOT a real service, just a template!
157
158 define service {
159
160 name generic-service ; The 'name' of this service template
161 active_checks_enabled 1 ; Active service checks are enabled
162 passive_checks_enabled 1 ; Passive service checks are enabled/accepted
163 parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
164 obsess_over_service 1 ; We should obsess over this service (if necessary)
165 check_freshness 0 ; Default is to NOT check service 'freshness'
166 notifications_enabled 1 ; Service notifications are enabled
167 event_handler_enabled 1 ; Service event handler is enabled
168 flap_detection_enabled 1 ; Flap detection is enabled
169 process_perf_data 1 ; Process performance data
170 retain_status_information 1 ; Retain status information across program restarts
171 retain_nonstatus_information 1 ; Retain non-status information across program restarts
172 is_volatile 0 ; The service is not volatile
173 check_period 24x7 ; The service can be checked at any time of the day
174 max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
175 check_interval 10 ; Check the service every 10 minutes under normal conditions
176 retry_interval 2 ; Re-check the service every two minutes until a hard state can be determined
177 contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
178 notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
179 notification_interval 60 ; Re-notify about service problems every hour
180 notification_period 24x7 ; Notifications can be sent out at any time
181 register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
182 }
183
184
185
186 # Local service definition template
187 # This is NOT a real service, just a template!
188
189 define service {
190
191 name local-service ; The name of this service template
192 use generic-service ; Inherit default values from the generic-service definition
193 max_check_attempts 4 ; Re-check the service up to 4 times in order to determine its final (hard) state
194 check_interval 5 ; Check the service every 5 minutes under normal conditions
195 retry_interval 1 ; Re-check the service every minute until a hard state can be determined
196 register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
197 }
0 ###############################################################################
1 # TEMPLATES.CFG - SAMPLE OBJECT TEMPLATES
2 #
3 #
4 # NOTES: This config file provides you with some example object definition
5 # templates that are referred by other host, service, contact, etc.
6 # definitions in other config files.
7 #
8 # You don't need to keep these definitions in a separate file from your
9 # other object definitions. This has been done just to make things
10 # easier to understand.
11 #
12 ###############################################################################
13
14
15
16 ###############################################################################
17 #
18 # CONTACT TEMPLATES
19 #
20 ###############################################################################
21
22 # Generic contact definition template
23 # This is NOT a real contact, just a template!
24
25 define contact {
26
27 name generic-contact ; The name of this contact template
28 service_notification_period 24x7 ; service notifications can be sent anytime
29 host_notification_period 24x7 ; host notifications can be sent anytime
30 service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
31 host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
32 service_notification_commands notify-service-by-email ; send service notifications via email
33 host_notification_commands notify-host-by-email ; send host notifications via email
34 register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
35 }
36
37
38
39 ###############################################################################
40 #
41 # HOST TEMPLATES
42 #
43 ###############################################################################
44
45 # Generic host definition template
46 # This is NOT a real host, just a template!
47
48 define host {
49
50 name generic-host ; The name of this host template
51 notifications_enabled 1 ; Host notifications are enabled
52 event_handler_enabled 1 ; Host event handler is enabled
53 flap_detection_enabled 1 ; Flap detection is enabled
54 process_perf_data 1 ; Process performance data
55 retain_status_information 1 ; Retain status information across program restarts
56 retain_nonstatus_information 1 ; Retain non-status information across program restarts
57 notification_period 24x7 ; Send host notifications at any time
58 register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
59 }
60
61
62
63 # Linux host definition template
64 # This is NOT a real host, just a template!
65
66 define host {
67
68 name linux-server ; The name of this host template
69 use generic-host ; This template inherits other values from the generic-host template
70 check_period 24x7 ; By default, Linux hosts are checked round the clock
71 check_interval 5 ; Actively check the host every 5 minutes
72 retry_interval 1 ; Schedule host check retries at 1 minute intervals
73 max_check_attempts 10 ; Check each Linux host 10 times (max)
74 check_command check-host-alive ; Default command to check Linux hosts
75 notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day
76 ; Note that the notification_period variable is being overridden from
77 ; the value that is inherited from the generic-host template!
78 notification_interval 120 ; Resend notifications every 2 hours
79 notification_options d,u,r ; Only send notifications for specific host states
80 contact_groups admins ; Notifications get sent to the admins by default
81 register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
82 }
83
84
85
86
87 # Windows host definition template
88 # This is NOT a real host, just a template!
89
90 define host {
91
92 name windows-server ; The name of this host template
93 use generic-host ; Inherit default values from the generic-host template
94 check_period 24x7 ; By default, Windows servers are monitored round the clock
95 check_interval 5 ; Actively check the server every 5 minutes
96 retry_interval 1 ; Schedule host check retries at 1 minute intervals
97 max_check_attempts 10 ; Check each server 10 times (max)
98 check_command check-host-alive ; Default command to check if servers are "alive"
99 notification_period 24x7 ; Send notification out at any time - day or night
100 notification_interval 30 ; Resend notifications every 30 minutes
101 notification_options d,r ; Only send notifications for specific host states
102 contact_groups admins ; Notifications get sent to the admins by default
103 hostgroups windows-servers ; Host groups that Windows servers should be a member of
104 register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
105 }
106
107
108
109 # We define a generic printer template that can
110 # be used for most printers we monitor
111
112 define host {
113
114 name generic-printer ; The name of this host template
115 use generic-host ; Inherit default values from the generic-host template
116 check_period 24x7 ; By default, printers are monitored round the clock
117 check_interval 5 ; Actively check the printer every 5 minutes
118 retry_interval 1 ; Schedule host check retries at 1 minute intervals
119 max_check_attempts 10 ; Check each printer 10 times (max)
120 check_command check-host-alive ; Default command to check if printers are "alive"
121 notification_period workhours ; Printers are only used during the workday
122 notification_interval 30 ; Resend notifications every 30 minutes
123 notification_options d,r ; Only send notifications for specific host states
124 contact_groups admins ; Notifications get sent to the admins by default
125 register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
126 }
127
128
129
130 # Define a template for switches that we can reuse
131 define host {
132
133 name generic-switch ; The name of this host template
134 use generic-host ; Inherit default values from the generic-host template
135 check_period 24x7 ; By default, switches are monitored round the clock
136 check_interval 5 ; Switches are checked every 5 minutes
137 retry_interval 1 ; Schedule host check retries at 1 minute intervals
138 max_check_attempts 10 ; Check each switch 10 times (max)
139 check_command check-host-alive ; Default command to check if routers are "alive"
140 notification_period 24x7 ; Send notifications at any time
141 notification_interval 30 ; Resend notifications every 30 minutes
142 notification_options d,r ; Only send notifications for specific host states
143 contact_groups admins ; Notifications get sent to the admins by default
144 register 0 ; DON'T REGISTER THIS - ITS JUST A TEMPLATE
145 }
146
147
148
149 ###############################################################################
150 #
151 # SERVICE TEMPLATES
152 #
153 ###############################################################################
154
155 # Generic service definition template
156 # This is NOT a real service, just a template!
157
158 define service {
159
160 name generic-service ; The 'name' of this service template
161 active_checks_enabled 1 ; Active service checks are enabled
162 passive_checks_enabled 1 ; Passive service checks are enabled/accepted
163 parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
164 obsess_over_service 1 ; We should obsess over this service (if necessary)
165 check_freshness 0 ; Default is to NOT check service 'freshness'
166 notifications_enabled 1 ; Service notifications are enabled
167 event_handler_enabled 1 ; Service event handler is enabled
168 flap_detection_enabled 1 ; Flap detection is enabled
169 process_perf_data 1 ; Process performance data
170 retain_status_information 1 ; Retain status information across program restarts
171 retain_nonstatus_information 1 ; Retain non-status information across program restarts
172 is_volatile 0 ; The service is not volatile
173 check_period 24x7 ; The service can be checked at any time of the day
174 max_check_attempts 3 ; Re-check the service up to 3 times in order to determine its final (hard) state
175 check_interval 10 ; Check the service every 10 minutes under normal conditions
176 retry_interval 2 ; Re-check the service every two minutes until a hard state can be determined
177 contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
178 notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
179 notification_interval 60 ; Re-notify about service problems every hour
180 notification_period 24x7 ; Notifications can be sent out at any time
181 register 0 ; DON'T REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
182 }
183
184
185
186 # Local service definition template
187 # This is NOT a real service, just a template!
188
189 define service {
190
191 name local-service ; The name of this service template
192 use generic-service ; Inherit default values from the generic-service definition
193 max_check_attempts 4 ; Re-check the service up to 4 times in order to determine its final (hard) state
194 check_interval 5 ; Check the service every 5 minutes under normal conditions
195 retry_interval 1 ; Re-check the service every minute until a hard state can be determined
196 register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
197 }
0 ###############################################################################
1 # TIMEPERIODS.CFG - SAMPLE TIMEPERIOD DEFINITIONS
2 #
3 #
4 # NOTES: This config file provides you with some example timeperiod definitions
5 # that you can reference in host, service, contact, and dependency
6 # definitions.
7 #
8 # You don't need to keep timeperiods in a separate file from your other
9 # object definitions. This has been done just to make things easier to
10 # understand.
11 #
12 ###############################################################################
13
14
15
16 ###############################################################################
17 #
18 # TIMEPERIOD DEFINITIONS
19 #
20 ###############################################################################
21
22 # This defines a timeperiod where all times are valid for checks,
23 # notifications, etc. The classic "24x7" support nightmare. :-)
24
25 define timeperiod {
26
27 name 24x7
28 timeperiod_name 24x7
29 alias 24 Hours A Day, 7 Days A Week
30
31 sunday 00:00-24:00
32 monday 00:00-24:00
33 tuesday 00:00-24:00
34 wednesday 00:00-24:00
35 thursday 00:00-24:00
36 friday 00:00-24:00
37 saturday 00:00-24:00
38 }
39
40
41
42 # This defines a timeperiod that is normal workhours for
43 # those of us monitoring networks and such in the U.S.
44
45 define timeperiod {
46
47 name workhours
48 timeperiod_name workhours
49 alias Normal Work Hours
50
51 monday 09:00-17:00
52 tuesday 09:00-17:00
53 wednesday 09:00-17:00
54 thursday 09:00-17:00
55 friday 09:00-17:00
56 }
57
58
59
60 # This defines the *perfect* check and notification
61 # timeperiod
62
63 define timeperiod {
64
65 name none
66 timeperiod_name none
67 alias No Time Is A Good Time
68 }
69
70
71
72 # Some U.S. holidays
73 # Note: The timeranges for each holiday are meant to *exclude* the holidays from being
74 # treated as a valid time for notifications, etc. You probably don't want your pager
75 # going off on New Year's. Although your employer might... :-)
76
77 define timeperiod {
78
79 name us-holidays
80 timeperiod_name us-holidays
81 alias U.S. Holidays
82
83 january 1 00:00-00:00 ; New Years
84 monday -1 may 00:00-00:00 ; Memorial Day (last Monday in May)
85 july 4 00:00-00:00 ; Independence Day
86 monday 1 september 00:00-00:00 ; Labor Day (first Monday in September)
87 thursday 4 november 00:00-00:00 ; Thanksgiving (4th Thursday in November)
88 december 25 00:00-00:00 ; Christmas
89 }
90
91
92
93 # This defines a modified "24x7" timeperiod that covers every day of the
94 # year, except for U.S. holidays (defined in the timeperiod above).
95
96 define timeperiod {
97
98 name 24x7_sans_holidays
99 timeperiod_name 24x7_sans_holidays
100 alias 24x7 Sans Holidays
101
102 use us-holidays ; Get holiday exceptions from other timeperiod
103
104 sunday 00:00-24:00
105 monday 00:00-24:00
106 tuesday 00:00-24:00
107 wednesday 00:00-24:00
108 thursday 00:00-24:00
109 friday 00:00-24:00
110 saturday 00:00-24:00
111 }
0 ###############################################################################
1 # TIMEPERIODS.CFG - SAMPLE TIMEPERIOD DEFINITIONS
2 #
3 #
4 # NOTES: This config file provides you with some example timeperiod definitions
5 # that you can reference in host, service, contact, and dependency
6 # definitions.
7 #
8 # You don't need to keep timeperiods in a separate file from your other
9 # object definitions. This has been done just to make things easier to
10 # understand.
11 #
12 ###############################################################################
13
14
15
16 ###############################################################################
17 #
18 # TIMEPERIOD DEFINITIONS
19 #
20 ###############################################################################
21
22 # This defines a timeperiod where all times are valid for checks,
23 # notifications, etc. The classic "24x7" support nightmare. :-)
24
25 define timeperiod {
26
27 name 24x7
28 timeperiod_name 24x7
29 alias 24 Hours A Day, 7 Days A Week
30
31 sunday 00:00-24:00
32 monday 00:00-24:00
33 tuesday 00:00-24:00
34 wednesday 00:00-24:00
35 thursday 00:00-24:00
36 friday 00:00-24:00
37 saturday 00:00-24:00
38 }
39
40
41
42 # This defines a timeperiod that is normal workhours for
43 # those of us monitoring networks and such in the U.S.
44
45 define timeperiod {
46
47 name workhours
48 timeperiod_name workhours
49 alias Normal Work Hours
50
51 monday 09:00-17:00
52 tuesday 09:00-17:00
53 wednesday 09:00-17:00
54 thursday 09:00-17:00
55 friday 09:00-17:00
56 }
57
58
59
60 # This defines the *perfect* check and notification
61 # timeperiod
62
63 define timeperiod {
64
65 name none
66 timeperiod_name none
67 alias No Time Is A Good Time
68 }
69
70
71
72 # Some U.S. holidays
73 # Note: The timeranges for each holiday are meant to *exclude* the holidays from being
74 # treated as a valid time for notifications, etc. You probably don't want your pager
75 # going off on New Year's. Although your employer might... :-)
76
77 define timeperiod {
78
79 name us-holidays
80 timeperiod_name us-holidays
81 alias U.S. Holidays
82
83 january 1 00:00-00:00 ; New Years
84 monday -1 may 00:00-00:00 ; Memorial Day (last Monday in May)
85 july 4 00:00-00:00 ; Independence Day
86 monday 1 september 00:00-00:00 ; Labor Day (first Monday in September)
87 thursday 4 november 00:00-00:00 ; Thanksgiving (4th Thursday in November)
88 december 25 00:00-00:00 ; Christmas
89 }
90
91
92
93 # This defines a modified "24x7" timeperiod that covers every day of the
94 # year, except for U.S. holidays (defined in the timeperiod above).
95
96 define timeperiod {
97
98 name 24x7_sans_holidays
99 timeperiod_name 24x7_sans_holidays
100 alias 24x7 Sans Holidays
101
102 use us-holidays ; Get holiday exceptions from other timeperiod
103
104 sunday 00:00-24:00
105 monday 00:00-24:00
106 tuesday 00:00-24:00
107 wednesday 00:00-24:00
108 thursday 00:00-24:00
109 friday 00:00-24:00
110 saturday 00:00-24:00
111 }
0 ###############################################################################
1 # WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE
2 #
3 #
4 # NOTES: This config file assumes that you are using the sample configuration
5 # files that get installed with the Nagios quickstart guide.
6 #
7 ###############################################################################
8
9
10
11 ###############################################################################
12 #
13 # HOST DEFINITIONS
14 #
15 ###############################################################################
16
17 # Define a host for the Windows machine we'll be monitoring
18 # Change the host_name, alias, and address to fit your situation
19
20 define host {
21
22 use windows-server ; Inherit default values from a template
23 host_name winserver ; The name we're giving to this host
24 alias My Windows Server ; A longer name associated with the host
25 address 192.168.1.2 ; IP address of the host
26 }
27
28
29
30 ###############################################################################
31 #
32 # HOST GROUP DEFINITIONS
33 #
34 ###############################################################################
35
36 # Define a hostgroup for Windows machines
37 # All hosts that use the windows-server template will automatically be a member of this group
38
39 define hostgroup {
40
41 hostgroup_name windows-servers ; The name of the hostgroup
42 alias Windows Servers ; Long name of the group
43 }
44
45
46
47 ###############################################################################
48 #
49 # SERVICE DEFINITIONS
50 #
51 ###############################################################################
52
53 # Create a service for monitoring the version of NSCLient++ that is installed
54 # Change the host_name to match the name of the host you defined above
55
56 define service {
57
58 use generic-service
59 host_name winserver
60 service_description NSClient++ Version
61 check_command check_nt!CLIENTVERSION
62 }
63
64
65
66 # Create a service for monitoring the uptime of the server
67 # Change the host_name to match the name of the host you defined above
68
69 define service {
70
71 use generic-service
72 host_name winserver
73 service_description Uptime
74 check_command check_nt!UPTIME
75 }
76
77
78
79 # Create a service for monitoring CPU load
80 # Change the host_name to match the name of the host you defined above
81
82 define service {
83
84 use generic-service
85 host_name winserver
86 service_description CPU Load
87 check_command check_nt!CPULOAD!-l 5,80,90
88 }
89
90
91
92 # Create a service for monitoring memory usage
93 # Change the host_name to match the name of the host you defined above
94
95 define service {
96
97 use generic-service
98 host_name winserver
99 service_description Memory Usage
100 check_command check_nt!MEMUSE!-w 80 -c 90
101 }
102
103
104
105 # Create a service for monitoring C:\ disk usage
106 # Change the host_name to match the name of the host you defined above
107
108 define service {
109
110 use generic-service
111 host_name winserver
112 service_description C:\ Drive Space
113 check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
114 }
115
116
117
118 # Create a service for monitoring the W3SVC service
119 # Change the host_name to match the name of the host you defined above
120
121 define service {
122
123 use generic-service
124 host_name winserver
125 service_description W3SVC
126 check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
127 }
128
129
130
131 # Create a service for monitoring the Explorer.exe process
132 # Change the host_name to match the name of the host you defined above
133
134 define service {
135
136 use generic-service
137 host_name winserver
138 service_description Explorer
139 check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
140 }
0 ###############################################################################
1 # WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE
2 #
3 #
4 # NOTES: This config file assumes that you are using the sample configuration
5 # files that get installed with the Nagios quickstart guide.
6 #
7 ###############################################################################
8
9
10
11 ###############################################################################
12 #
13 # HOST DEFINITIONS
14 #
15 ###############################################################################
16
17 # Define a host for the Windows machine we'll be monitoring
18 # Change the host_name, alias, and address to fit your situation
19
20 define host {
21
22 use windows-server ; Inherit default values from a template
23 host_name winserver ; The name we're giving to this host
24 alias My Windows Server ; A longer name associated with the host
25 address 192.168.1.2 ; IP address of the host
26 }
27
28
29
30 ###############################################################################
31 #
32 # HOST GROUP DEFINITIONS
33 #
34 ###############################################################################
35
36 # Define a hostgroup for Windows machines
37 # All hosts that use the windows-server template will automatically be a member of this group
38
39 define hostgroup {
40
41 hostgroup_name windows-servers ; The name of the hostgroup
42 alias Windows Servers ; Long name of the group
43 }
44
45
46
47 ###############################################################################
48 #
49 # SERVICE DEFINITIONS
50 #
51 ###############################################################################
52
53 # Create a service for monitoring the version of NSCLient++ that is installed
54 # Change the host_name to match the name of the host you defined above
55
56 define service {
57
58 use generic-service
59 host_name winserver
60 service_description NSClient++ Version
61 check_command check_nt!CLIENTVERSION
62 }
63
64
65
66 # Create a service for monitoring the uptime of the server
67 # Change the host_name to match the name of the host you defined above
68
69 define service {
70
71 use generic-service
72 host_name winserver
73 service_description Uptime
74 check_command check_nt!UPTIME
75 }
76
77
78
79 # Create a service for monitoring CPU load
80 # Change the host_name to match the name of the host you defined above
81
82 define service {
83
84 use generic-service
85 host_name winserver
86 service_description CPU Load
87 check_command check_nt!CPULOAD!-l 5,80,90
88 }
89
90
91
92 # Create a service for monitoring memory usage
93 # Change the host_name to match the name of the host you defined above
94
95 define service {
96
97 use generic-service
98 host_name winserver
99 service_description Memory Usage
100 check_command check_nt!MEMUSE!-w 80 -c 90
101 }
102
103
104
105 # Create a service for monitoring C:\ disk usage
106 # Change the host_name to match the name of the host you defined above
107
108 define service {
109
110 use generic-service
111 host_name winserver
112 service_description C:\ Drive Space
113 check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
114 }
115
116
117
118 # Create a service for monitoring the W3SVC service
119 # Change the host_name to match the name of the host you defined above
120
121 define service {
122
123 use generic-service
124 host_name winserver
125 service_description W3SVC
126 check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
127 }
128
129
130
131 # Create a service for monitoring the Explorer.exe process
132 # Change the host_name to match the name of the host you defined above
133
134 define service {
135
136 use generic-service
137 host_name winserver
138 service_description Explorer
139 check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
140 }