cloud-mu 3.6.10 → 3.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Berksfile +2 -3
- data/Berksfile.lock +11 -14
- data/bin/mu-aws-setup +16 -4
- data/bin/mu-configure +2 -1
- data/cloud-mu.gemspec +2 -2
- data/cookbooks/mu-firewall/Berksfile +1 -1
- data/cookbooks/mu-firewall/attributes/default.rb +2 -2
- data/cookbooks/mu-firewall/metadata.rb +3 -3
- data/cookbooks/mu-firewall/recipes/default.rb +11 -2
- data/cookbooks/mu-master/Berksfile +1 -1
- data/cookbooks/mu-master/attributes/default.rb +14 -1
- data/cookbooks/mu-master/files/default/389ds-perl/ASDialogs.pm +173 -0
- data/cookbooks/mu-master/files/default/389ds-perl/AdminMigration.pm +569 -0
- data/cookbooks/mu-master/files/default/389ds-perl/AdminServer.pm +952 -0
- data/cookbooks/mu-master/files/default/389ds-perl/AdminUtil.pm +983 -0
- data/cookbooks/mu-master/files/default/389ds-perl/ConfigDSDialogs.pm +449 -0
- data/cookbooks/mu-master/files/default/389ds-perl/DSCreate.pm +1551 -0
- data/cookbooks/mu-master/files/default/389ds-perl/DSDialogs.pm +233 -0
- data/cookbooks/mu-master/files/default/389ds-perl/DSMigration.pm +1175 -0
- data/cookbooks/mu-master/files/default/389ds-perl/DSUpdate.pm +534 -0
- data/cookbooks/mu-master/files/default/389ds-perl/DSUpdateDialogs.pm +152 -0
- data/cookbooks/mu-master/files/default/389ds-perl/DSUtil.pm +1710 -0
- data/cookbooks/mu-master/files/default/389ds-perl/Dialog.pm +249 -0
- data/cookbooks/mu-master/files/default/389ds-perl/DialogManager.pm +212 -0
- data/cookbooks/mu-master/files/default/389ds-perl/FileConn.pm +461 -0
- data/cookbooks/mu-master/files/default/389ds-perl/Inf.pm +268 -0
- data/cookbooks/mu-master/files/default/389ds-perl/Migration.pm +327 -0
- data/cookbooks/mu-master/files/default/389ds-perl/RegDSDialogs.pm +94 -0
- data/cookbooks/mu-master/files/default/389ds-perl/Resource.pm +137 -0
- data/cookbooks/mu-master/files/default/389ds-perl/Setup.pm +240 -0
- data/cookbooks/mu-master/files/default/389ds-perl/SetupDialogs.pm +243 -0
- data/cookbooks/mu-master/files/default/389ds-perl/SetupLog.pm +82 -0
- data/cookbooks/mu-master/files/default/setCertName.ldif +4 -0
- data/cookbooks/mu-master/libraries/mu.rb +2 -2
- data/cookbooks/mu-master/metadata.rb +1 -1
- data/cookbooks/mu-master/recipes/389ds.rb +71 -32
- data/cookbooks/mu-master/recipes/basepackages.rb +5 -0
- data/cookbooks/mu-master/recipes/default.rb +16 -5
- data/cookbooks/mu-master/recipes/init.rb +36 -3
- data/cookbooks/mu-master/recipes/ssl-certs.rb +6 -0
- data/cookbooks/mu-master/recipes/sssd.rb +85 -62
- data/cookbooks/mu-master/recipes/update_nagios_only.rb +7 -1
- data/cookbooks/mu-master/templates/default/389-directory-setup.inf.erb +11 -26
- data/cookbooks/mu-master/templates/default/sssd.conf.erb +18 -8
- data/cookbooks/mu-tools/files/default/Mu_CA.pem +33 -0
- data/cookbooks/mu-tools/metadata.rb +0 -1
- data/cookbooks/mu-tools/recipes/set_local_fw.rb +7 -1
- data/cookbooks/mu-tools/templates/amazon/sshd_config.erb +5 -1
- data/cookbooks/nagios/CHANGELOG.md +679 -0
- data/cookbooks/nagios/LICENSE +201 -0
- data/cookbooks/nagios/README.md +340 -0
- data/cookbooks/nagios/attributes/config.rb +163 -0
- data/cookbooks/nagios/attributes/default.rb +204 -0
- data/cookbooks/nagios/libraries/base.rb +311 -0
- data/cookbooks/nagios/libraries/command.rb +68 -0
- data/cookbooks/nagios/libraries/contact.rb +229 -0
- data/cookbooks/nagios/libraries/contactgroup.rb +111 -0
- data/cookbooks/{firewall/recipes/disable_firewall.rb → nagios/libraries/custom_option.rb} +20 -7
- data/cookbooks/nagios/libraries/data_bag_helper.rb +23 -0
- data/cookbooks/nagios/libraries/default.rb +90 -0
- data/cookbooks/nagios/libraries/helpers.rb +229 -0
- data/cookbooks/nagios/libraries/host.rb +410 -0
- data/cookbooks/nagios/libraries/hostdependency.rb +178 -0
- data/cookbooks/nagios/libraries/hostescalation.rb +170 -0
- data/cookbooks/nagios/libraries/hostgroup.rb +117 -0
- data/cookbooks/nagios/libraries/nagios.rb +277 -0
- data/cookbooks/nagios/libraries/resource.rb +59 -0
- data/cookbooks/nagios/libraries/service.rb +449 -0
- data/cookbooks/nagios/libraries/servicedependency.rb +213 -0
- data/cookbooks/nagios/libraries/serviceescalation.rb +193 -0
- data/cookbooks/nagios/libraries/servicegroup.rb +142 -0
- data/cookbooks/nagios/libraries/timeperiod.rb +159 -0
- data/cookbooks/nagios/libraries/users_helper.rb +54 -0
- data/cookbooks/nagios/metadata.json +44 -0
- data/cookbooks/nagios/metadata.rb +22 -0
- data/cookbooks/nagios/recipes/_load_databag_config.rb +153 -0
- data/cookbooks/nagios/recipes/_load_default_config.rb +241 -0
- data/cookbooks/nagios/recipes/apache.rb +114 -0
- data/cookbooks/nagios/recipes/default.rb +41 -0
- data/cookbooks/nagios/recipes/nginx.rb +114 -0
- data/cookbooks/nagios/recipes/pagerduty.rb +95 -0
- data/cookbooks/nagios/recipes/server.rb +182 -0
- data/cookbooks/nagios/recipes/server_package.rb +85 -0
- data/cookbooks/nagios/recipes/server_source.rb +137 -0
- data/cookbooks/nagios/resources/command.rb +34 -0
- data/cookbooks/nagios/resources/conf.rb +52 -0
- data/cookbooks/nagios/resources/contact.rb +34 -0
- data/cookbooks/nagios/resources/contactgroup.rb +35 -0
- data/cookbooks/nagios/resources/host.rb +35 -0
- data/cookbooks/nagios/resources/hostdependency.rb +35 -0
- data/cookbooks/nagios/resources/hostescalation.rb +36 -0
- data/cookbooks/nagios/resources/hostgroup.rb +35 -0
- data/cookbooks/nagios/resources/resource.rb +34 -0
- data/cookbooks/nagios/resources/service.rb +35 -0
- data/cookbooks/nagios/resources/servicedependency.rb +35 -0
- data/cookbooks/nagios/resources/serviceescalation.rb +35 -0
- data/cookbooks/nagios/resources/servicegroup.rb +35 -0
- data/cookbooks/nagios/resources/timeperiod.rb +35 -0
- data/cookbooks/nagios/templates/apache2.conf.erb +102 -0
- data/cookbooks/nagios/templates/cgi.cfg.erb +266 -0
- data/cookbooks/nagios/templates/commands.cfg.erb +13 -0
- data/cookbooks/nagios/templates/contacts.cfg.erb +37 -0
- data/cookbooks/nagios/templates/hostgroups.cfg.erb +25 -0
- data/cookbooks/nagios/templates/hosts.cfg.erb +15 -0
- data/cookbooks/nagios/templates/htpasswd.users.erb +6 -0
- data/cookbooks/nagios/templates/nagios.cfg.erb +22 -0
- data/cookbooks/nagios/templates/nginx.conf.erb +80 -0
- data/cookbooks/nagios/templates/pagerduty.cgi.erb +185 -0
- data/cookbooks/nagios/templates/resource.cfg.erb +27 -0
- data/cookbooks/nagios/templates/servicedependencies.cfg.erb +15 -0
- data/cookbooks/nagios/templates/servicegroups.cfg.erb +14 -0
- data/cookbooks/nagios/templates/services.cfg.erb +14 -0
- data/cookbooks/nagios/templates/spawn-fcgi.erb +10 -0
- data/cookbooks/nagios/templates/templates.cfg.erb +31 -0
- data/cookbooks/nagios/templates/timeperiods.cfg.erb +13 -0
- data/extras/platform_berksfile_base +3 -3
- data/extras/python_rpm/build.sh +4 -4
- data/extras/python_rpm/muthon.spec +2 -4
- data/extras/vault_tools/export_vaults.sh +11 -1
- data/install/installer +1 -1
- data/modules/mu/kittens.rb +27523 -0
- data/modules/mu/master/ldap.rb +48 -31
- data/modules/mu/master.rb +69 -0
- data/modules/mu/mu.yaml.rb +351 -0
- data/modules/mu/providers/aws/firewall_rule.rb +3 -1
- data/modules/mu/providers/aws.rb +11 -5
- data/modules/mu.rb +5 -4
- metadata +99 -48
- data/cookbooks/firewall/CHANGELOG.md +0 -488
- data/cookbooks/firewall/LICENSE +0 -202
- data/cookbooks/firewall/README.md +0 -366
- data/cookbooks/firewall/TODO.md +0 -6
- data/cookbooks/firewall/attributes/default.rb +0 -5
- data/cookbooks/firewall/attributes/firewalld.rb +0 -8
- data/cookbooks/firewall/attributes/iptables.rb +0 -17
- data/cookbooks/firewall/attributes/ufw.rb +0 -12
- data/cookbooks/firewall/attributes/windows.rb +0 -8
- data/cookbooks/firewall/libraries/helpers.rb +0 -105
- data/cookbooks/firewall/libraries/helpers_firewalld.rb +0 -116
- data/cookbooks/firewall/libraries/helpers_firewalld_dbus.rb +0 -72
- data/cookbooks/firewall/libraries/helpers_iptables.rb +0 -112
- data/cookbooks/firewall/libraries/helpers_nftables.rb +0 -170
- data/cookbooks/firewall/libraries/helpers_ufw.rb +0 -142
- data/cookbooks/firewall/libraries/helpers_windows.rb +0 -129
- data/cookbooks/firewall/libraries/provider_firewall_firewalld.rb +0 -179
- data/cookbooks/firewall/libraries/provider_firewall_iptables.rb +0 -171
- data/cookbooks/firewall/libraries/provider_firewall_iptables_ubuntu.rb +0 -200
- data/cookbooks/firewall/libraries/provider_firewall_iptables_ubuntu1404.rb +0 -200
- data/cookbooks/firewall/libraries/provider_firewall_rule.rb +0 -34
- data/cookbooks/firewall/libraries/provider_firewall_ufw.rb +0 -138
- data/cookbooks/firewall/libraries/provider_firewall_windows.rb +0 -126
- data/cookbooks/firewall/libraries/resource_firewall.rb +0 -26
- data/cookbooks/firewall/libraries/resource_firewall_rule.rb +0 -52
- data/cookbooks/firewall/metadata.json +0 -40
- data/cookbooks/firewall/metadata.rb +0 -15
- data/cookbooks/firewall/recipes/default.rb +0 -76
- data/cookbooks/firewall/recipes/firewalld.rb +0 -87
- data/cookbooks/firewall/resources/firewalld.rb +0 -28
- data/cookbooks/firewall/resources/firewalld_config.rb +0 -39
- data/cookbooks/firewall/resources/firewalld_helpers.rb +0 -106
- data/cookbooks/firewall/resources/firewalld_icmptype.rb +0 -88
- data/cookbooks/firewall/resources/firewalld_ipset.rb +0 -104
- data/cookbooks/firewall/resources/firewalld_policy.rb +0 -115
- data/cookbooks/firewall/resources/firewalld_service.rb +0 -98
- data/cookbooks/firewall/resources/firewalld_zone.rb +0 -118
- data/cookbooks/firewall/resources/nftables.rb +0 -71
- data/cookbooks/firewall/resources/nftables_rule.rb +0 -113
- data/cookbooks/firewall/templates/default/ufw/default.erb +0 -13
- /data/cookbooks/{firewall → nagios}/chefignore +0 -0
- /data/cookbooks/{firewall → nagios}/renovate.json +0 -0
@@ -0,0 +1,266 @@
|
|
1
|
+
# Autogenerated by Chef.
|
2
|
+
#
|
3
|
+
# MAIN CONFIGURATION FILE
|
4
|
+
# This tells the CGIs where to find your main configuration file.
|
5
|
+
# The CGIs will read the main and host config files for any other
|
6
|
+
# data they might need.
|
7
|
+
|
8
|
+
main_config_file=<%= node['nagios']['conf_dir'] %>/<%= node['nagios']['server']['name'] %>.cfg
|
9
|
+
|
10
|
+
# PHYSICAL HTML PATH
|
11
|
+
# This is the path where the HTML files for Nagios reside. This
|
12
|
+
# value is used to locate the logo images needed by the statusmap
|
13
|
+
# and statuswrl CGIs.
|
14
|
+
|
15
|
+
physical_html_path=<%= node['nagios']['docroot'] %>
|
16
|
+
|
17
|
+
# URL HTML PATH
|
18
|
+
# This is the path portion of the URL that corresponds to the
|
19
|
+
# physical location of the Nagios HTML files (as defined above).
|
20
|
+
# This value is used by the CGIs to locate the online documentation
|
21
|
+
# and graphics. If you access the Nagios pages with an URL like
|
22
|
+
# http://www.myhost.com/nagios, this value should be '/nagios'
|
23
|
+
# (without the quotes).
|
24
|
+
|
25
|
+
url_html_path=/<%= node['nagios']['server']['vname'] %>
|
26
|
+
|
27
|
+
# CONTEXT-SENSITIVE HELP
|
28
|
+
# This option determines whether or not a context-sensitive
|
29
|
+
# help icon will be displayed for most of the CGIs.
|
30
|
+
# Values: 0 = disables context-sensitive help
|
31
|
+
# 1 = enables context-sensitive help
|
32
|
+
|
33
|
+
show_context_help=<%= node['nagios']['cgi']['show_context_help'] %>
|
34
|
+
|
35
|
+
# NAGIOS PROCESS CHECK COMMAND
|
36
|
+
# This is the full path and filename of the program used to check
|
37
|
+
# the status of the Nagios process. It is used only by the CGIs
|
38
|
+
# and is completely optional. However, if you don't use it, you'll
|
39
|
+
# see warning messages in the CGIs about the Nagios process
|
40
|
+
# not running and you won't be able to execute any commands from
|
41
|
+
# the web interface. The program should follow the same rules
|
42
|
+
# as plugins; the return codes are the same as for the plugins,
|
43
|
+
# it should have timeout protection, it should output something
|
44
|
+
# to STDIO, etc.
|
45
|
+
#
|
46
|
+
# Note: The command line for the check_nagios plugin below may
|
47
|
+
# have to be tweaked a bit, as different versions of the plugin
|
48
|
+
# use different command line arguments/syntaxes.
|
49
|
+
|
50
|
+
<%= node['nagios']['server']['name'] %>_check_command=<%= node['nagios']['plugin_dir'] %>/check_nagios <%= node['nagios']['cache_dir'] %>/status.dat 5 '/usr/sbin/<%= @nagios_service_name %>'
|
51
|
+
|
52
|
+
# AUTHENTICATION USAGE
|
53
|
+
# This option controls whether or not the CGIs will use any
|
54
|
+
# authentication when displaying host and service information, as
|
55
|
+
# well as committing commands to Nagios for processing.
|
56
|
+
#
|
57
|
+
# Read the HTML documentation to learn how the authorization works!
|
58
|
+
#
|
59
|
+
# NOTE: It is a really *bad* idea to disable authorization, unless
|
60
|
+
# you plan on removing the command CGI (cmd.cgi)! Failure to do
|
61
|
+
# so will leave you wide open to kiddies messing with Nagios and
|
62
|
+
# possibly hitting you with a denial of service attack by filling up
|
63
|
+
# your drive by continuously writing to your command file!
|
64
|
+
#
|
65
|
+
# Setting this value to 0 will cause the CGIs to *not* use
|
66
|
+
# authentication (bad idea), while any other value will make them
|
67
|
+
# use the authentication functions (the default).
|
68
|
+
|
69
|
+
use_authentication=1
|
70
|
+
|
71
|
+
# DEFAULT USER
|
72
|
+
# Setting this variable will define a default user name that can
|
73
|
+
# access pages without authentication. This allows people within a
|
74
|
+
# secure domain (i.e., behind a firewall) to see the current status
|
75
|
+
# without authenticating. You may want to use this to avoid basic
|
76
|
+
# authentication if you are not using a secure server since basic
|
77
|
+
# authentication transmits passwords in the clear.
|
78
|
+
#
|
79
|
+
# Important: Do not define a default username unless you are
|
80
|
+
# running a secure web server and are sure that everyone who has
|
81
|
+
# access to the CGIs has been authenticated in some manner! If you
|
82
|
+
# define this variable, anyone who has not authenticated to the web
|
83
|
+
# server will inherit all rights you assign to this user!
|
84
|
+
|
85
|
+
<% if node['nagios']['default_user_name'] -%>
|
86
|
+
default_user_name=<%= @node['nagios']['default_user_name'] %>
|
87
|
+
<% else -%>
|
88
|
+
#default_user_name=guest
|
89
|
+
<% end -%>
|
90
|
+
|
91
|
+
# SYSTEM/PROCESS INFORMATION ACCESS
|
92
|
+
# This option is a comma-delimited list of all usernames that
|
93
|
+
# have access to viewing the Nagios process information as
|
94
|
+
# provided by the Extended Information CGI (extinfo.cgi). By
|
95
|
+
# default, *no one* has access to this unless you choose to
|
96
|
+
# not use authorization. You may use an asterisk (*) to
|
97
|
+
# authorize any user who has authenticated to the web server.
|
98
|
+
|
99
|
+
authorized_for_system_information=<%= node['nagios']['cgi']['authorized_for_system_information'] %>
|
100
|
+
|
101
|
+
# CONFIGURATION INFORMATION ACCESS
|
102
|
+
# This option is a comma-delimited list of all usernames that
|
103
|
+
# can view ALL configuration information (hosts, commands, etc).
|
104
|
+
# By default, users can only view configuration information
|
105
|
+
# for the hosts and services they are contacts for. You may use
|
106
|
+
# an asterisk (*) to authorize any user who has authenticated
|
107
|
+
# to the web server.
|
108
|
+
|
109
|
+
authorized_for_configuration_information=<%= node['nagios']['cgi']['authorized_for_configuration_information'] %>
|
110
|
+
|
111
|
+
# SYSTEM/PROCESS COMMAND ACCESS
|
112
|
+
# This option is a comma-delimited list of all usernames that
|
113
|
+
# can issue shutdown and restart commands to Nagios via the
|
114
|
+
# command CGI (cmd.cgi). Users in this list can also change
|
115
|
+
# the program mode to active or standby. By default, *no one*
|
116
|
+
# has access to this unless you choose to not use authorization.
|
117
|
+
# You may use an asterisk (*) to authorize any user who has
|
118
|
+
# authenticated to the web server.
|
119
|
+
|
120
|
+
authorized_for_system_commands=<%= node['nagios']['cgi']['authorized_for_system_commands'] %>
|
121
|
+
|
122
|
+
# GLOBAL HOST/SERVICE VIEW ACCESS
|
123
|
+
# These two options are comma-delimited lists of all usernames that
|
124
|
+
# can view information for all hosts and services that are being
|
125
|
+
# monitored. By default, users can only view information
|
126
|
+
# for hosts or services that they are contacts for (unless you
|
127
|
+
# you choose to not use authorization). You may use an asterisk (*)
|
128
|
+
# to authorize any user who has authenticated to the web server.
|
129
|
+
|
130
|
+
|
131
|
+
authorized_for_all_services=<%= node['nagios']['cgi']['authorized_for_all_services'] %>
|
132
|
+
authorized_for_all_hosts=<%= node['nagios']['cgi']['authorized_for_all_hosts'] %>
|
133
|
+
|
134
|
+
# GLOBAL HOST/SERVICE COMMAND ACCESS
|
135
|
+
# These two options are comma-delimited lists of all usernames that
|
136
|
+
# can issue host or service related commands via the command
|
137
|
+
# CGI (cmd.cgi) for all hosts and services that are being monitored.
|
138
|
+
# By default, users can only issue commands for hosts or services
|
139
|
+
# that they are contacts for (unless you you choose to not use
|
140
|
+
# authorization). You may use an asterisk (*) to authorize any
|
141
|
+
# user who has authenticated to the web server.
|
142
|
+
|
143
|
+
authorized_for_all_service_commands=<%= node['nagios']['cgi']['authorized_for_all_service_commands'] %>
|
144
|
+
authorized_for_all_host_commands=<%= node['nagios']['cgi']['authorized_for_all_host_commands'] %>
|
145
|
+
|
146
|
+
# STATUSMAP BACKGROUND IMAGE
|
147
|
+
# This option allows you to specify an image to be used as a
|
148
|
+
# background in the statusmap CGI. It is assumed that the image
|
149
|
+
# resides in the HTML images path (i.e. /usr/local/nagios/share/images).
|
150
|
+
# This path is automatically determined by appending "/images"
|
151
|
+
# to the path specified by the 'physical_html_path' directive.
|
152
|
+
# Note: The image file may be in GIF, PNG, JPEG, or GD2 format.
|
153
|
+
# However, I recommend that you convert your image to GD2 format
|
154
|
+
# (uncompressed), as this will cause less CPU load when the CGI
|
155
|
+
# generates the image.
|
156
|
+
|
157
|
+
#statusmap_background_image=smbackground.gd2
|
158
|
+
|
159
|
+
# DEFAULT STATUSMAP LAYOUT METHOD
|
160
|
+
# This option allows you to specify the default layout method
|
161
|
+
# the statusmap CGI should use for drawing hosts. If you do
|
162
|
+
# not use this option, the default is to use user-defined
|
163
|
+
# coordinates. Valid options are as follows:
|
164
|
+
# 0 = User-defined coordinates
|
165
|
+
# 1 = Depth layers
|
166
|
+
# 2 = Collapsed tree
|
167
|
+
# 3 = Balanced tree
|
168
|
+
# 4 = Circular
|
169
|
+
# 5 = Circular (Marked Up)
|
170
|
+
|
171
|
+
default_statusmap_layout=<%= node['nagios']['cgi']['default_statusmap_layout'] %>
|
172
|
+
|
173
|
+
# DEFAULT STATUSWRL LAYOUT METHOD
|
174
|
+
# This option allows you to specify the default layout method
|
175
|
+
# the statuswrl (VRML) CGI should use for drawing hosts. If you
|
176
|
+
# do not use this option, the default is to use user-defined
|
177
|
+
# coordinates. Valid options are as follows:
|
178
|
+
# 0 = User-defined coordinates
|
179
|
+
# 2 = Collapsed tree
|
180
|
+
# 3 = Balanced tree
|
181
|
+
# 4 = Circular
|
182
|
+
|
183
|
+
default_statuswrl_layout=<%= node['nagios']['cgi']['default_statuswrl_layout'] %>
|
184
|
+
|
185
|
+
# STATUSWRL INCLUDE
|
186
|
+
# This option allows you to include your own objects in the
|
187
|
+
# generated VRML world. It is assumed that the file
|
188
|
+
# resides in the HTML path (i.e. /usr/local/nagios/share).
|
189
|
+
|
190
|
+
#statuswrl_include=myworld.wrl
|
191
|
+
|
192
|
+
# PING SYNTAX
|
193
|
+
# This option determines what syntax should be used when
|
194
|
+
# attempting to ping a host from the WAP interface (using
|
195
|
+
# the statuswml CGI. You must include the full path to
|
196
|
+
# the ping binary, along with all required options. The
|
197
|
+
# $HOSTADDRESS$ macro is substituted with the address of
|
198
|
+
# the host before the command is executed.
|
199
|
+
# Please note that the syntax for the ping binary is
|
200
|
+
# notorious for being different on virtually ever *NIX
|
201
|
+
# OS and distribution, so you may have to tweak this to
|
202
|
+
# work on your system.
|
203
|
+
|
204
|
+
ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
|
205
|
+
|
206
|
+
# REFRESH RATE
|
207
|
+
# This option allows you to specify the refresh rate in seconds
|
208
|
+
# of various CGIs (status, statusmap, extinfo, and outages).
|
209
|
+
|
210
|
+
refresh_rate=90
|
211
|
+
|
212
|
+
# DEFAULT PAGE LIMIT
|
213
|
+
# This option allows you to specify the default number of results
|
214
|
+
# displayed on the status.cgi. This number can be adjusted from
|
215
|
+
# within the UI after the initial page load. Setting this to 0
|
216
|
+
# will show all results.
|
217
|
+
|
218
|
+
result_limit=<%= node['nagios']['cgi']['result_limit'] %>
|
219
|
+
|
220
|
+
# ESCAPE HTML TAGS
|
221
|
+
# This option determines whether HTML tags in host and service
|
222
|
+
# status output is escaped in the web interface. If enabled,
|
223
|
+
# your plugin output will not be able to contain clickable links.
|
224
|
+
|
225
|
+
escape_html_tags=<%= node['nagios']['cgi']['escape_html_tags'] %>
|
226
|
+
|
227
|
+
# SOUND OPTIONS
|
228
|
+
# These options allow you to specify an optional audio file
|
229
|
+
# that should be played in your browser window when there are
|
230
|
+
# problems on the network. The audio files are used only in
|
231
|
+
# the status CGI. Only the sound for the most critical problem
|
232
|
+
# will be played. Order of importance (higher to lower) is as
|
233
|
+
# follows: unreachable hosts, down hosts, critical services,
|
234
|
+
# warning services, and unknown services. If there are no
|
235
|
+
# visible problems, the sound file optionally specified by
|
236
|
+
# 'normal_sound' variable will be played.
|
237
|
+
#
|
238
|
+
#
|
239
|
+
# <varname>=<sound_file>
|
240
|
+
#
|
241
|
+
# Note: All audio files must be placed in the /media subdirectory
|
242
|
+
# under the HTML path (i.e. /usr/local/nagios/share/media/).
|
243
|
+
|
244
|
+
#host_unreachable_sound=hostdown.wav
|
245
|
+
#host_down_sound=hostdown.wav
|
246
|
+
#service_critical_sound=critical.wav
|
247
|
+
#service_warning_sound=warning.wav
|
248
|
+
#service_unknown_sound=warning.wav
|
249
|
+
#normal_sound=noproblem.wav
|
250
|
+
|
251
|
+
# URL TARGET FRAMES
|
252
|
+
# These options determine the target frames in which notes and
|
253
|
+
# action URLs will open.
|
254
|
+
|
255
|
+
action_url_target=<%= node['nagios']['cgi']['action_url_target'] %>
|
256
|
+
notes_url_target=<%= node['nagios']['cgi']['notes_url_target'] %>
|
257
|
+
|
258
|
+
|
259
|
+
# LOCK AUTHOR NAMES OPTION
|
260
|
+
# This option determines whether users can change the author name
|
261
|
+
# when submitting comments, scheduling downtime. If disabled, the
|
262
|
+
# author names will be locked into their contact name, as defined in Nagios.
|
263
|
+
# Values: 0 = allow editing author names
|
264
|
+
# 1 = lock author names (disallow editing)
|
265
|
+
|
266
|
+
lock_author_names=<%= node['nagios']['cgi']['lock_author_names'] %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# $Id: Generated by chef for node: <%= node['hostname'] %>
|
2
|
+
# ----------------------------------------------------------------
|
3
|
+
# NOTE: This file is controlled by chef templates!
|
4
|
+
# Do not edit or change this file but change the following:
|
5
|
+
# template file : commands.cfg.erb
|
6
|
+
# ----------------------------------------------------------------
|
7
|
+
# Command definitions
|
8
|
+
# ----------------------------------------------------------------
|
9
|
+
|
10
|
+
<% Nagios.instance.commands.each do |key,command| -%>
|
11
|
+
<%= command.definition %>
|
12
|
+
|
13
|
+
<% end -%>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# $Id: Generated by chef for node: <%= node['hostname'] %>
|
2
|
+
# ----------------------------------------------------------------
|
3
|
+
# NOTE: This file is controlled by chef templates!
|
4
|
+
# Do not edit or change this file but change the following:
|
5
|
+
# template file : contacts.cfg.erb
|
6
|
+
# ----------------------------------------------------------------
|
7
|
+
# Contact definitions
|
8
|
+
# Contactgroup definitions
|
9
|
+
# ----------------------------------------------------------------
|
10
|
+
|
11
|
+
<% Nagios.instance.contacts.each do |key,contact| -%>
|
12
|
+
<% if contact.name.nil? # Skipping all the template contacts %>
|
13
|
+
<%= contact.definition %>
|
14
|
+
|
15
|
+
<% end %>
|
16
|
+
<% end -%>
|
17
|
+
|
18
|
+
<% Nagios.instance.contactgroups.each do |key,group| -%>
|
19
|
+
<% if group.name.nil? # Skipping all the template contactgroups %>
|
20
|
+
<%= group.definition %>
|
21
|
+
|
22
|
+
<% end %>
|
23
|
+
<% end -%>
|
24
|
+
|
25
|
+
<% Nagios.instance.serviceescalations.each do |escalation| -%>
|
26
|
+
<% if escalation.name.nil? # Skipping all the template serviceescalations %>
|
27
|
+
<%= escalation.definition %>
|
28
|
+
|
29
|
+
<% end %>
|
30
|
+
<% end -%>
|
31
|
+
|
32
|
+
<% Nagios.instance.hostescalations.each do |escalation| -%>
|
33
|
+
<% if escalation.name.nil? # Skipping all the template hostescalations %>
|
34
|
+
<%= escalation.definition %>
|
35
|
+
|
36
|
+
<% end %>
|
37
|
+
<% end -%>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# $Id: Generated by chef for node: <%= node['hostname'] %>
|
2
|
+
# ----------------------------------------------------------------
|
3
|
+
# NOTE: This file is controlled by chef templates!
|
4
|
+
# Do not edit or change this file but change the following:
|
5
|
+
# template file : hostgroups.cfg.erb
|
6
|
+
# ----------------------------------------------------------------
|
7
|
+
# Hostgroup definitions
|
8
|
+
# ----------------------------------------------------------------
|
9
|
+
|
10
|
+
define hostgroup {
|
11
|
+
hostgroup_name all
|
12
|
+
alias all
|
13
|
+
<% if node['nagios']['regexp_matching'] == 1 -%>
|
14
|
+
members .*
|
15
|
+
<% else -%>
|
16
|
+
members *
|
17
|
+
<% end -%>
|
18
|
+
}
|
19
|
+
|
20
|
+
<% Nagios.instance.hostgroups.each do |key,hostgroup| -%>
|
21
|
+
<% if hostgroup.name.nil? # Skipping all the template hosts %>
|
22
|
+
<%= hostgroup.definition unless hostgroup.hostgroup_name == 'all' %>
|
23
|
+
|
24
|
+
<% end %>
|
25
|
+
<% end -%>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# $Id: Generated by chef for node: <%= node['hostname'] %>
|
2
|
+
# ----------------------------------------------------------------
|
3
|
+
# NOTE: This file is controlled by chef templates!
|
4
|
+
# Do not edit or change this file but change the following:
|
5
|
+
# template file : hosts.cfg.erb
|
6
|
+
# ----------------------------------------------------------------
|
7
|
+
# Host definitions
|
8
|
+
# ----------------------------------------------------------------
|
9
|
+
|
10
|
+
<% Nagios.instance.hosts.each do |key,host| -%>
|
11
|
+
<% if host.name.nil? # Skipping all the template hosts %>
|
12
|
+
<%= host.definition %>
|
13
|
+
|
14
|
+
<% end %>
|
15
|
+
<% end -%>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# $Id: Autogenerated by Chef.
|
2
|
+
# ----------------------------------------------------------------
|
3
|
+
# NOTE: This file is controlled by chef templates!
|
4
|
+
# Do not edit or change this file but change the following:
|
5
|
+
# cookbook : nagios
|
6
|
+
# template file : nagios.cfg.erb
|
7
|
+
# ----------------------------------------------------------------
|
8
|
+
# Nagios Configuration
|
9
|
+
# ----------------------------------------------------------------
|
10
|
+
|
11
|
+
<% @nagios_config.each do |key,items| %>
|
12
|
+
<% case items %>
|
13
|
+
<% when String %>
|
14
|
+
<%= key + '=' + items %>
|
15
|
+
<% when Integer %>
|
16
|
+
<%= key + '=' + items.to_s %>
|
17
|
+
<% when Array %>
|
18
|
+
<% items.each do |item| %>
|
19
|
+
<%= key + '=' + item %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
server {
|
2
|
+
|
3
|
+
listen <%= @listen_port %>;
|
4
|
+
<% if @nagios_url %>
|
5
|
+
server_name <%= @nagios_url %>;
|
6
|
+
<% else %>
|
7
|
+
server_name <%= @server_name %> <%= @server_name %>.<%= @chef_env %>.<%= @public_domain %> <%= @fqdn %>;
|
8
|
+
<% end %>
|
9
|
+
access_log <%= File.join(@log_dir, 'nginx_access.log') %>;
|
10
|
+
error_log <%= File.join(@log_dir, 'nginx_error.log') %>;
|
11
|
+
root <%= @docroot %>;
|
12
|
+
<% unless node['nagios']['allowed_ips'].empty? -%>
|
13
|
+
satisfy any;
|
14
|
+
<%= @allowed_ips.join(";\n") %>;
|
15
|
+
deny all;
|
16
|
+
<% end -%>
|
17
|
+
auth_basic "Nagios Server";
|
18
|
+
auth_basic_user_file <%= @htpasswd_file %>;
|
19
|
+
index index.php index.html index.cgi;
|
20
|
+
|
21
|
+
<% if @https %>
|
22
|
+
ssl on;
|
23
|
+
ssl_certificate <%= @ssl_cert_file %>;
|
24
|
+
ssl_certificate_key <%= @ssl_cert_key %>;
|
25
|
+
ssl_ciphers HIGH;
|
26
|
+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
27
|
+
ssl_prefer_server_ciphers on;
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<% if @cgi %>
|
31
|
+
location ~ \.cgi$ {
|
32
|
+
root <%= node['nagios']['cgi-bin'] %>;
|
33
|
+
gzip off;
|
34
|
+
fastcgi_pass <%= @nginx_dispatch_cgi_url.to_s %>;
|
35
|
+
fastcgi_index index.cgi;
|
36
|
+
fastcgi_param SCRIPT_FILENAME <%= @cgi_bin_dir %>$fastcgi_script_name;
|
37
|
+
|
38
|
+
include /etc/nginx/fastcgi_params;
|
39
|
+
|
40
|
+
fastcgi_param AUTH_USER $remote_user;
|
41
|
+
fastcgi_param REMOTE_USER $remote_user;
|
42
|
+
|
43
|
+
}
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<% if @php %>
|
47
|
+
location ~ .php$ {
|
48
|
+
gzip off;
|
49
|
+
fastcgi_pass <%= @nginx_dispatch_php_url.to_s %>;
|
50
|
+
fastcgi_index index.php;
|
51
|
+
fastcgi_param SCRIPT_FILENAME <%= @docroot %>$fastcgi_script_name;
|
52
|
+
|
53
|
+
include /etc/nginx/fastcgi_params;
|
54
|
+
|
55
|
+
fastcgi_param AUTH_USER $remote_user;
|
56
|
+
fastcgi_param REMOTE_USER $remote_user;
|
57
|
+
|
58
|
+
}
|
59
|
+
<% end %>
|
60
|
+
|
61
|
+
<% if node['platform_family'] == 'debian' && node['nagios']['server']['install_method'] == 'package'-%>
|
62
|
+
location /stylesheets {
|
63
|
+
alias /etc/<%= @server_vname %>/stylesheets;
|
64
|
+
}
|
65
|
+
|
66
|
+
location /<%= @server_vname %>/stylesheets {
|
67
|
+
alias /etc/<%= @server_vname %>/stylesheets;
|
68
|
+
}
|
69
|
+
<% end -%>
|
70
|
+
|
71
|
+
location / {
|
72
|
+
root <%= @docroot %>;
|
73
|
+
try_files $uri $uri/ index.php /<%= node['nagios']['server']['vname'] %>;
|
74
|
+
}
|
75
|
+
|
76
|
+
location /<%= @server_vname %> {
|
77
|
+
alias <%= @docroot %>;
|
78
|
+
}
|
79
|
+
|
80
|
+
}
|
@@ -0,0 +1,185 @@
|
|
1
|
+
#!/usr/bin/env perl
|
2
|
+
|
3
|
+
use warnings;
|
4
|
+
use strict;
|
5
|
+
|
6
|
+
use CGI;
|
7
|
+
use JSON;
|
8
|
+
use LWP::UserAgent;
|
9
|
+
|
10
|
+
# =============================================================================
|
11
|
+
|
12
|
+
my $CONFIG = {
|
13
|
+
# Nagios/Ubuntu defaults
|
14
|
+
'command_file' => '<%= @command_file %>', # External commands file
|
15
|
+
# Icinga/CentOS defaults
|
16
|
+
#'command_file' => '/var/spool/icinga/cmd/icinga.cmd', # External commands file
|
17
|
+
# Icinga acknowledgement TTL
|
18
|
+
'ack_ttl' => 0, # Time in seconds the acknowledgement in Icinga last before
|
19
|
+
# it times out automatically. 0 means the acknowledgement
|
20
|
+
# never expires. If you're using Nagios this MUST be 0.
|
21
|
+
};
|
22
|
+
|
23
|
+
# =============================================================================
|
24
|
+
|
25
|
+
sub ackHost {
|
26
|
+
my ($time, $host, $comment, $author, $sticky, $notify, $persistent) = @_;
|
27
|
+
|
28
|
+
# Open the external commands file
|
29
|
+
if (! open (NAGIOS, '>>', $CONFIG->{'command_file'})) {
|
30
|
+
# Well shizzle
|
31
|
+
return (undef, $!);
|
32
|
+
}
|
33
|
+
|
34
|
+
# Success! Write the command
|
35
|
+
if ($CONFIG->{'ack_ttl'} <= 0) {
|
36
|
+
printf (NAGIOS "[%u] ACKNOWLEDGE_HOST_PROBLEM;%s;%u;%u;%u;%s;%s\n", $time, $host, $sticky, $notify, $persistent, $author, $comment);
|
37
|
+
|
38
|
+
} else {
|
39
|
+
printf (NAGIOS "[%u] ACKNOWLEDGE_HOST_PROBLEM_EXPIRE;%s;%u;%u;%u;%u;%s;%s\n", $time, $host, $sticky, $notify, $persistent, ($time + $CONFIG->{'ack_ttl'}), $author, $comment);
|
40
|
+
}
|
41
|
+
# Close the file handle
|
42
|
+
close (NAGIOS);
|
43
|
+
|
44
|
+
# Return with happiness
|
45
|
+
return (1, undef);
|
46
|
+
}
|
47
|
+
|
48
|
+
# =============================================================================
|
49
|
+
|
50
|
+
sub deackHost {
|
51
|
+
my ($time, $host) = @_;
|
52
|
+
|
53
|
+
# Open the external commands file
|
54
|
+
if (! open (NAGIOS, '>>', $CONFIG->{'command_file'})) {
|
55
|
+
# Well shizzle
|
56
|
+
return (undef, $!);
|
57
|
+
}
|
58
|
+
|
59
|
+
# Success! Write the command
|
60
|
+
printf (NAGIOS "[%u] REMOVE_HOST_ACKNOWLEDGEMENT;%s\n", $time, $host);
|
61
|
+
# Close the file handle
|
62
|
+
close (NAGIOS);
|
63
|
+
|
64
|
+
# Return with happiness
|
65
|
+
return (1, undef);
|
66
|
+
}
|
67
|
+
|
68
|
+
# =============================================================================
|
69
|
+
|
70
|
+
sub ackService {
|
71
|
+
my ($time, $host, $service, $comment, $author, $sticky, $notify, $persistent) = @_;
|
72
|
+
|
73
|
+
# Open the external commands file
|
74
|
+
if (! open (NAGIOS, '>>', $CONFIG->{'command_file'})) {
|
75
|
+
# Well shizzle
|
76
|
+
return (undef, $!);
|
77
|
+
}
|
78
|
+
|
79
|
+
# Success! Write the command
|
80
|
+
if ($CONFIG->{'ack_ttl'} <= 0) {
|
81
|
+
printf (NAGIOS "[%u] ACKNOWLEDGE_SVC_PROBLEM;%s;%s;%u;%u;%u;%s;%s\n", $time, $host, $service, $sticky, $notify, $persistent, $author, $comment);
|
82
|
+
|
83
|
+
} else {
|
84
|
+
printf (NAGIOS "[%u] ACKNOWLEDGE_SVC_PROBLEM_EXPIRE;%s;%s;%u;%u;%u;%u;%s;%s\n", $time, $host, $service, $sticky, $notify, $persistent, ($time + $CONFIG->{'ack_ttl'}), $author, $comment);
|
85
|
+
}
|
86
|
+
|
87
|
+
# Close the file handle
|
88
|
+
close (NAGIOS);
|
89
|
+
|
90
|
+
# Return with happiness
|
91
|
+
return (1, undef);
|
92
|
+
}
|
93
|
+
|
94
|
+
# =============================================================================
|
95
|
+
|
96
|
+
sub deackService {
|
97
|
+
my ($time, $host, $service) = @_;
|
98
|
+
|
99
|
+
# Open the external commands file
|
100
|
+
if (! open (NAGIOS, '>>', $CONFIG->{'command_file'})) {
|
101
|
+
# Well shizzle
|
102
|
+
return (undef, $!);
|
103
|
+
}
|
104
|
+
|
105
|
+
# Success! Write the command
|
106
|
+
printf (NAGIOS "[%u] REMOVE_SVC_ACKNOWLEDGEMENT;%s;%s\n", $time, $host, $service);
|
107
|
+
# Close the file handle
|
108
|
+
close (NAGIOS);
|
109
|
+
|
110
|
+
# Return with happiness
|
111
|
+
return (1, undef);
|
112
|
+
}
|
113
|
+
|
114
|
+
# =============================================================================
|
115
|
+
|
116
|
+
my ($TIME, $QUERY, $POST, $JSON);
|
117
|
+
|
118
|
+
$TIME = time ();
|
119
|
+
|
120
|
+
$QUERY = CGI->new ();
|
121
|
+
|
122
|
+
if (! defined ($POST = $QUERY->param ('POSTDATA'))) {
|
123
|
+
print ("Status: 400 Requests must be POSTs\n\n400 Requests must be POSTs\n");
|
124
|
+
exit (0);
|
125
|
+
}
|
126
|
+
|
127
|
+
if (! defined ($JSON = JSON->new ()->utf8 ()->decode ($POST))) {
|
128
|
+
print ("Status: 400 Request payload must be JSON blob\n\n400 Request payload must JSON blob\n");
|
129
|
+
exit (0);
|
130
|
+
}
|
131
|
+
|
132
|
+
if ((ref ($JSON) ne 'HASH') || ! defined ($JSON->{'messages'}) || (ref ($JSON->{'messages'}) ne 'ARRAY')) {
|
133
|
+
print ("Status: 400 JSON blob does not match the expected format\n\n400 JSON blob does not match expected format\n");
|
134
|
+
exit (0);
|
135
|
+
}
|
136
|
+
|
137
|
+
my ($message, $return);
|
138
|
+
$return = {
|
139
|
+
'status' => 'okay',
|
140
|
+
'messages' => {}
|
141
|
+
};
|
142
|
+
|
143
|
+
MESSAGE: foreach $message (@{$JSON->{'messages'}}) {
|
144
|
+
my ($hostservice, $status, $error);
|
145
|
+
|
146
|
+
if ((ref ($message) ne 'HASH') || ! defined ($message->{'type'})) {
|
147
|
+
next MESSAGE;
|
148
|
+
}
|
149
|
+
|
150
|
+
$hostservice = $message->{'data'}->{'incident'}->{'trigger_summary_data'};
|
151
|
+
|
152
|
+
if (! defined ($hostservice)) {
|
153
|
+
next MESSAGE;
|
154
|
+
}
|
155
|
+
|
156
|
+
if ($message->{'type'} eq 'incident.acknowledge') {
|
157
|
+
if (! defined ($hostservice->{'SERVICEDESC'})) {
|
158
|
+
($status, $error) = ackHost ($TIME, $hostservice->{'HOSTNAME'}, 'Acknowledged by PagerDuty', 'PagerDuty', 2, 0, 0);
|
159
|
+
|
160
|
+
} else {
|
161
|
+
($status, $error) = ackService ($TIME, $hostservice->{'HOSTNAME'}, $hostservice->{'SERVICEDESC'}, 'Acknowledged by PagerDuty', 'PagerDuty', 2, 0, 0);
|
162
|
+
}
|
163
|
+
|
164
|
+
$return->{'messages'}{$message->{'id'}} = {
|
165
|
+
'status' => ($status ? 'okay' : 'fail'),
|
166
|
+
'message' => ($error ? $error : undef)
|
167
|
+
};
|
168
|
+
|
169
|
+
} elsif ($message->{'type'} eq 'incident.unacknowledge') {
|
170
|
+
if (! defined ($hostservice->{'SERVICEDESC'})) {
|
171
|
+
($status, $error) = deackHost ($TIME, $hostservice->{'HOSTNAME'});
|
172
|
+
|
173
|
+
} else {
|
174
|
+
($status, $error) = deackService ($TIME, $hostservice->{'HOSTNAME'}, $hostservice->{'SERVICEDESC'});
|
175
|
+
}
|
176
|
+
|
177
|
+
$return->{'messages'}->{$message->{'id'}} = {
|
178
|
+
'status' => ($status ? 'okay' : 'fail'),
|
179
|
+
'message' => ($error ? $error : undef)
|
180
|
+
};
|
181
|
+
$return->{'status'} = ($status eq 'okay' ? $return->{'status'} : 'fail');
|
182
|
+
}
|
183
|
+
}
|
184
|
+
|
185
|
+
printf ("Status: 200 Okay\nContent-type: application/json\n\n%s\n", JSON->new ()->utf8 ()->encode ($return));
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# $Id: Generated by chef for node: <%= node['hostname'] %>
|
2
|
+
# ----------------------------------------------------------------
|
3
|
+
# NOTE: This file is controlled by chef templates!
|
4
|
+
# Do not edit or change this file but change the following:
|
5
|
+
# template file : resource.cfg.erb
|
6
|
+
# ----------------------------------------------------------------
|
7
|
+
# You can define $USERx$ macros in this file, which can in turn be used
|
8
|
+
# in command definitions in your host config file(s). $USERx$ macros are
|
9
|
+
# useful for storing sensitive information such as usernames, passwords,
|
10
|
+
# etc. They are also handy for specifying the path to plugins and
|
11
|
+
# event handlers - if you decide to move the plugins or event handlers to
|
12
|
+
# a different directory in the future, you can just update one or two
|
13
|
+
# $USERx$ macros, instead of modifying a lot of command definitions.
|
14
|
+
#
|
15
|
+
# The CGIs will not attempt to read the contents of resource files, so
|
16
|
+
# you can set restrictive permissions (600 or 660) on them.
|
17
|
+
#
|
18
|
+
# Nagios supports up to 256 $USERx$ macros ($USER1$ through $USER256$)
|
19
|
+
#
|
20
|
+
# Resource files may also be used to store configuration directives for
|
21
|
+
# external data sources like MySQL...
|
22
|
+
# ----------------------------------------------------------------
|
23
|
+
|
24
|
+
<% Nagios.instance.resources.each do |key,res| -%>
|
25
|
+
<%= res.definition %>
|
26
|
+
<% end -%>
|
27
|
+
|