OSDN Git Service

adds NRPE no ssl support.
[metasearch/grid-chef-repo.git] / cookbooks / nagios-grid / attributes / default.rb
1 #
2 # Cookbook Name:: nagios-grid
3 # Attributes:: default
4 #
5 # Copyright 2016, whitestar
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19
20 default['nagios']['base_cfg_dir'] = 'base'
21 default['nagios']['site_cfg_dir'] = 'site'
22 default['nagios']['autostart'] = true
23 default['nagios']['autoreload'] = true
24 default['nagios']['with_pnp4nagios'] = false
25
26 # nagios.cfg
27 default['nagios']['check_external_commands'] = '0'
28 default['nagios']['command_file'] = node.value_for_platform_family(
29   'debian' => '/var/lib/nagios3/rw/nagios.cmd',
30   'rhel' => '/var/spool/nagios/cmd/nagios.cmd'
31 )
32 default['nagios']['use_regexp_matching'] = '0'
33
34 # cgi
35 default['nagios']['cgi'] = {
36   'authorized_for_system_information'        => 'nagiosadmin',
37   'authorized_for_configuration_information' => 'nagiosadmin',
38   'authorized_for_system_commands'           => 'nagiosadmin',
39   'authorized_for_all_services'              => 'nagiosadmin',
40   'authorized_for_all_hosts'                 => 'nagiosadmin',
41   'authorized_for_all_service_commands'      => 'nagiosadmin',
42   'authorized_for_all_host_commands'         => 'nagiosadmin',
43   'result_limit' => '100',
44 }
45
46 # Web UI
47 ## >= 2.3
48 default['nagios']['web']['Require'] = [
49   'all granted',
50 ]
51 ## < 2.3
52 default['nagios']['web']['Order'] = 'Allow,Deny'  # e.g. 'Deny,Allow'
53 default['nagios']['web']['Deny'] = []  # ['From All']
54 default['nagios']['web']['Allow'] = [
55   'From All',
56   # e.g.
57   #'from 127.0.0.1',
58   #'from ::1'
59 ]
60 ## AuthType: 'none'|'Basic'|'Kerberos'
61 default['nagios']['web']['AuthType'] = 'Basic'
62 ### if AuthType == Basic
63 default['nagios']['web']['mod_auth_basic']['AuthUserFile'] = node.value_for_platform_family(
64   'debian' => '/etc/nagios3/htpasswd.users',
65   'rhel'   => '/etc/nagios/passwd'
66 )
67 ### if AuthType == Kerberos
68 default['nagios']['web']['mod_auth_kerb']['KrbAuthRealms'] = 'LOCALDOMAIN'
69 default['nagios']['web']['mod_auth_kerb']['KrbServiceName'] = 'HTTP'
70 default['nagios']['web']['mod_auth_kerb']['Krb5Keytab'] = '/etc/krb5.keytab'
71 default['nagios']['web']['mod_auth_kerb']['KrbMethodNegotiate'] = 'on'
72 default['nagios']['web']['mod_auth_kerb']['KrbMethodK5Passwd'] = 'off'
73
74 # objects
75 ## default template base
76 default['nagios']['objects']['default_contact_groups'] = 'admins'
77 default['nagios']['objects']['check_ldap'] = {
78   'base' => 'dc=example,dc=com',
79 }
80 ## full customization
81 default['nagios']['objects']['commands'] = []
82 default['nagios']['objects']['hosts'] = []
83 default['nagios']['objects']['hostgroups'] = []
84 default['nagios']['objects']['hostdependencies'] = []
85 default['nagios']['objects']['hostescalations'] = []
86 default['nagios']['objects']['hostextinfos'] = []
87 default['nagios']['objects']['services'] = []
88 default['nagios']['objects']['servicegroups'] = []
89 default['nagios']['objects']['servicedependencies'] = []
90 default['nagios']['objects']['serviceescalations'] = []
91 default['nagios']['objects']['serviceextinfos'] = []
92 default['nagios']['objects']['contacts'] = []
93 default['nagios']['objects']['contactgroups'] = []
94 default['nagios']['objects']['timeperiods'] = []
95
96 # for check_ganglia_metric
97 default['nagios']['NagAconda']['version'] = '0.1.4'
98 #default['nagios']['NagAconda']['version'] = '0.2.1'
99 default['nagios']['check_ganglia_metric']['enabled'] = false
100 default['nagios']['check_ganglia_metric']['gmetad_host'] = 'localhost'
101
102 # NRPE
103 ## command
104 default['nagios']['check_nrpe']['nossl'] = false
105 ## server
106 default['nagios']['nrpe']['default'] = {
107   # expanded in the `/etc/default/nagios-nrpe-server`
108   #'NRPE_OPTS' => '"-n"',          # new env. var. e.g. Ubuntu 18.04
109   #'DAEMON_OPTS' => '"--no-ssl"',  # old env. var. e.g. Debian 8
110   #'NICENESS' = '5',
111   #'INETD' = '0',
112 }
113 default['nagios']['nrpe']['allowed_hosts'] = '127.0.0.1'
114 default['nagios']['nrpe']['with_smartmontools'] = false
115 default['nagios']['nrpe']['check_mem.pl'] = {
116   'warn' => '80',
117   'crit' => '90',
118   'extra_opts' => '-u',  # -u|f, -C
119 }
120 default['nagios']['nrpe']['check_load'] = {
121   'warn' => '15,10,5',
122   'crit' => '30,25,20',
123 }
124 default['nagios']['nrpe']['check_total_procs'] = {
125   'warn' => '100',
126   'crit' => '200',
127 }
128 (0..3).each {|num|
129   default['nagios']['nrpe']["check_disk#{num}"] = {
130     'warn' => '20%',
131     'crit' => '10%',
132     'path' => '/',
133     'extra_opts' => '',
134   }
135 }
136 (0..3).each {|num|
137   default['nagios']['nrpe']["check_smart#{num}"] = {
138     'device' => '/dev/sda',
139   }
140 }
141 default['nagios']['nrpe']['check_dig'] = {
142   'host' => '127.0.0.1',
143   'lookup' => 'host-a.example.com',
144 }
145 default['nagios']['nrpe']['check_dig_in'] = {
146   'host' => '127.0.0.1',
147   'lookup' => 'host-b.example.com',
148 }
149 default['nagios']['nrpe']['check_dig_ex'] = {
150   'host' => '127.0.0.1',
151   'lookup' => 'www.google.com',
152 }
153 default['nagios']['nrpe']['check_logs']['log_files'] = [
154 =begin
155   {
156     'file_name' => '/var/log/messages',
157     'reg_exp' => '(WARNING|CRITICAL)',
158     'lines' => 2,               #optional number of output lines  after match
159     'new_line_reg_exp' => '^',  #optional new line regex to stop output lines
160     'seek_file_suffix' => '2'   #optional seek file suffix
161   }
162 =end
163 ]