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,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
@@ -0,0 +1,340 @@
|
|
1
|
+
# nagios cookbook
|
2
|
+
|
3
|
+
[](https://supermarket.chef.io/cookbooks/nagios)
|
4
|
+
[](https://github.com/sous-chefs/nagios/actions?query=workflow%3Aci)
|
5
|
+
[](#backers)
|
6
|
+
[](#sponsors)
|
7
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
8
|
+
|
9
|
+
Installs and configures Nagios server. Chef nodes are automatically discovered using search, and Nagios host groups are created based on Chef roles and optionally environments as well.
|
10
|
+
|
11
|
+
## Maintainers
|
12
|
+
|
13
|
+
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit [sous-chefs.org](https://sous-chefs.org/) or come chat with us on the Chef Community Slack in [#sous-chefs](https://chefcommunity.slack.com/messages/C2V7B88SF).
|
14
|
+
|
15
|
+
## Requirements
|
16
|
+
|
17
|
+
### Chef
|
18
|
+
|
19
|
+
Chef Infra Client version 15.3+ is required
|
20
|
+
|
21
|
+
Because of the heavy use of search, this recipe will not work with Chef Solo, as it cannot do any searches without a server.
|
22
|
+
|
23
|
+
This cookbook relies heavily on multiple data bags. See --Data Bag-- below.
|
24
|
+
|
25
|
+
The system running this cookbooks should have a role named 'monitoring' so that NRPE clients can authorize monitoring from that system. This role name is configurable via an attribute. See --Attributes-- below.
|
26
|
+
|
27
|
+
The functionality that was previously in the nagios::client recipe has been moved to its own NRPE cookbook at <https://github.com/sous-chefs/nrpe>
|
28
|
+
|
29
|
+
### Platform
|
30
|
+
|
31
|
+
- Debian 10+
|
32
|
+
- Ubuntu 18.04+
|
33
|
+
- Red Hat Enterprise Linux (CentOS) 7+
|
34
|
+
|
35
|
+
--Notes--: This cookbook has been tested on the listed platforms. It may work on other platforms with or without modification.
|
36
|
+
|
37
|
+
### Cookbooks
|
38
|
+
|
39
|
+
- apache2
|
40
|
+
- nginx
|
41
|
+
- nrpe
|
42
|
+
- php
|
43
|
+
- yum-epel
|
44
|
+
- zap
|
45
|
+
|
46
|
+
## Attributes
|
47
|
+
|
48
|
+
### config
|
49
|
+
|
50
|
+
[The config file](https://github.com/sous-chefs/nagios/blob/master/attributes/config.rb) contains the Nagios configuration options. Consult the [nagios documentation](http://nagios.sourceforge.net/docs/3_0/configmain.html) for available settings and allowed options. Configuration entries of which multiple entries are allowed, need to be specified as an Array.
|
51
|
+
|
52
|
+
Example: `default['nagios']['conf']['cfg_dir'] = [ '/etc/nagios/conf.d' , '/usr/local/nagios/conf.d' ]`
|
53
|
+
|
54
|
+
### default attributes
|
55
|
+
|
56
|
+
- `node['nagios']['user']` - Nagios user, default 'nagios'.
|
57
|
+
- `node['nagios']['group']` - Nagios group, default 'nagios'.
|
58
|
+
- `node['nagios']['plugin_dir']` - location where Nagios plugins go, default '/usr/lib/nagios/plugins'.
|
59
|
+
- `node['nagios']['multi_environment_monitoring']` - Chef server will monitor hosts in all environments, not just its own, default 'false'
|
60
|
+
- `node['nagios']['monitored_environments']` - If multi_environment_monitoring is 'true' nagios will monitor nodes in all environments. If monitored_environments is defined then nagios will monitor only hosts in the list of environments defined. For ex: ['prod', 'beta'] will monitor only hosts in 'prod' and 'beta' chef_environments. Defaults to '[]' - and all chef environments will be monitored by default.
|
61
|
+
- `node['nagios']['monitoring_interface']` - If set, will use the specified interface for all nagios monitoring network traffic. Defaults to `nil`
|
62
|
+
- `node['nagios']['exclude_tag_host']` - If set, hosts tagged with this value will be excluded from nagios monitoring. Defaults to ''
|
63
|
+
|
64
|
+
- `node['nagios']['server']['install_method']` - whether to install from package or source. Default chosen by platform based on known packages available for Nagios: debian/ubuntu 'package', redhat/centos/scientific: source
|
65
|
+
- `node['nagios']['server']['install_yum-epel']` - whether to install the EPEL repo or not (only applies to RHEL platform family). The default value is `true`. Set this to `false` if you do not wish to install the EPEL RPM; in this scenario you will need to make the relevant packages available via another method e.g. local repo, or install from source.
|
66
|
+
- `node['nagios']['server']['service_name']` - name of the service used for Nagios, default chosen by platform, debian/ubuntu "nagios3", redhat family "nagios", all others, "nagios"
|
67
|
+
- `node['nagios']['home']` - Nagios main home directory, default "/usr/lib/nagios3"
|
68
|
+
- `node['nagios']['conf_dir']` - location where main Nagios config lives, default "/etc/nagios3"
|
69
|
+
- `node['nagios']['resource_dir']` - location for recources, default "/etc/nagios3"
|
70
|
+
- `node['nagios']['config_dir']` - location where included configuration files live, default "/etc/nagios3/conf.d"
|
71
|
+
- `node['nagios']['log_dir']` - location of Nagios logs, default "/var/log/nagios3"
|
72
|
+
- `node['nagios']['cache_dir']` - location of cached data, default "/var/cache/nagios3"
|
73
|
+
- `node['nagios']['state_dir']` - Nagios runtime state information, default "/var/lib/nagios3"
|
74
|
+
- `node['nagios']['run_dir']` - where pidfiles are stored, default "/var/run/nagios3"
|
75
|
+
- `node['nagios']['docroot']` - Nagios webui docroot, default "/usr/share/nagios3/htdocs"
|
76
|
+
- `node['nagios']['enable_ssl']` - boolean for whether Nagios web server should be https, default false
|
77
|
+
- `node['nagios']['ssl_cert_file']` = Location of SSL Certificate File. default "/etc/nagios3/certificates/nagios-server.pem"
|
78
|
+
- `node['nagios']['ssl_cert_chain_file']` = Optional location of SSL Intermediate Certificate File. No default.
|
79
|
+
- `node['nagios']['ssl_cert_key']` = Location of SSL Certificate Key. default "/etc/nagios3/certificates/nagios-server.pem"
|
80
|
+
- `node['nagios']['ssl_protocols']` = The SSLProtocol string to pass to apache, defaults to "all -SSL3 -SSL2"
|
81
|
+
- `node['nagios']['ssl_ciphers']` = The SSLCipherSuite string to pass to apache, defaults to empty (which will result in this setting not being included in the apache config)
|
82
|
+
- `node['nagios']['http_port']` - port that the Apache/Nginx virtual site should listen on, determined whether ssl is enabled (443 if so, otherwise 80). Note: You will also need to configure the listening port for either NGINX or Apache within those cookbooks.
|
83
|
+
- `node['nagios']['server_name']` - common name to use in a server cert, default "nagios"
|
84
|
+
- `node['nagios']['server']['server_alias']` - alias name for the webserver for use with Apache. Defaults to nil
|
85
|
+
- `node['nagios']['ssl_req']` - info to use in a cert, default `/C=US/ST=Several/L=Locality/O=Example/OU=Operations/CN=#{node['nagios']['server_name']}/emailAddress=ops@#{node['nagios']['server_name']}`
|
86
|
+
|
87
|
+
- `node['nagios']['server']['version']` - version of the server source to download
|
88
|
+
- `node['nagios']['server']['checksum']` - checksum of the source files
|
89
|
+
- `node['nagios']['server']['source_url']` - nagios core source url
|
90
|
+
- `node['nagios']['server']['patch_url']` - url to download patches from if installing from source
|
91
|
+
- `node['nagios']['server']['patches']` - array of patch filenames to apply if installing from source
|
92
|
+
- `node['nagios']['url']` - URL to host Nagios from - defaults to nil and instead uses FQDN
|
93
|
+
|
94
|
+
- `node['nagios']['conf']['enable_notifications']` - set to 1 to enable notification.
|
95
|
+
- `node['nagios']['conf']['interval_length']` - minimum interval. Defaults to '1'.
|
96
|
+
- `node['nagios']['conf']['use_timezone']` - set the timezone for nagios AND apache. Defaults to UTC.
|
97
|
+
- `node['nagios']['conf']['use_large_installation_tweaks']` - Attribute to enable [large installation tweaks](http://nagios.sourceforge.net/docs/3_0/largeinstalltweaks.html). Defaults to 0.
|
98
|
+
|
99
|
+
- `node['nagios']['check_external_commands']`
|
100
|
+
- `node['nagios']['default_contact_groups']`
|
101
|
+
- `node['nagios']['default_user_name']` - Specify a defaut guest user to allow page access without authentication. --Only-- use this if nagios is running behind a secure webserver and users have been authenticated in some manner. You'll likely want to change `node['nagios']['server_auth_require']` to `all granted`. Defaults to `nil`.
|
102
|
+
- `node['nagios']['sysadmin_email']` - default notification email.
|
103
|
+
- `node['nagios']['sysadmin_sms_email']` - default notification sms.
|
104
|
+
- `node['nagios']['server_auth_method']` - authentication with the server can be done with openid (using `apache2::mod_auth_openid`), cas (using `apache2::mod_auth_cas`),ldap (using `apache2::mod_authnz_ldap`), or htauth (basic). The default is htauth. "openid" will utilize openid authentication, "cas" will utilize cas authentication, "ldap" will utilize LDAP authentication, and any other value will use htauth (basic).
|
105
|
+
- `node['nagios']['cas_login_url']` - login url for cas if using cas authentication.
|
106
|
+
- `node['nagios']['cas_validate_url']` - validation url for cas if using cas authentication.
|
107
|
+
- `node['nagios']['cas_validate_server']` - whether to validate the server cert. Defaults to off.
|
108
|
+
- `node['nagios']['cas_root_proxy_url']` - if set, sets the url that the cas server redirects to after auth.
|
109
|
+
- `node['nagios']['ldap_bind_dn']` - DN used to bind to the server when searching for ldap entries.
|
110
|
+
- `node['nagios']['ldap_bind_password']` - bind password used with the DN provided for searching ldap.
|
111
|
+
- `node['nagios']['ldap_url']` - ldap url and search parameters.
|
112
|
+
- `node['nagios']['ldap_authoritative']` - accepts "on" or "off". controls other authentication modules from authenticating the user if this one fails.
|
113
|
+
- `node['nagios']['ldap_group_attribute']` - Set the Apache AuthLDAPGroupAttribute directive to a non-default value.
|
114
|
+
- `node['nagios']['ldap_group_attribute_is_dn']` - accepts "on" or "off". Set the Apache AuthLDAPGroupAttributeIsDN directive. Apache's default behavior is currently "on."
|
115
|
+
- `node['nagios']['ldap_verify_cert']` - accepts "on" or "off". Set the Apache mod_ldap LDAPVerifyServerCert directive. Apache's default behavior is currently "on."
|
116
|
+
- `node['nagios']['ldap_trusted_mode']` - Set the Apache mod_ldap LDAPTrustedMode directive.
|
117
|
+
- `node['nagios']['ldap_trusted_global_cert']` - Set the Apache mod_ldap LDAPTrustedGlobalCert directive.
|
118
|
+
- `node['nagios']['users_databag']` - the databag containing users to search for. defaults to users
|
119
|
+
- `node['nagios']['users_databag_group']` - users databag group considered Nagios admins. defaults to sysadmin
|
120
|
+
- `node['nagios']['services_databag']` - the databag containing services to search for. defaults to nagios_services
|
121
|
+
- `node['nagios']['servicegroups_databag']` - the databag containing servicegroups to search for. defaults to nagios_servicegroups
|
122
|
+
- `node['nagios']['templates_databag']` - the databag containing templates to search for. defaults to nagios_templates
|
123
|
+
- `node['nagios']['hostgroups_databag']` - the databag containing hostgroups to search for. defaults to nagios_hostgroups
|
124
|
+
- `node['nagios']['hosttemplates_databag']` - the databag containing host templates to search for. defaults to nagios_hosttemplates
|
125
|
+
- `node['nagios']['eventhandlers_databag']` - the databag containing eventhandlers to search for. defaults to nagios_eventhandlers
|
126
|
+
- `node['nagios']['unmanagedhosts_databag']` - the databag containing unmanagedhosts to search for. defaults to nagios_unmanagedhosts
|
127
|
+
- `node['nagios']['serviceescalations_databag']` - the databag containing serviceescalations to search for. defaults to nagios_serviceescalations
|
128
|
+
- `node['nagios']['hostescalations_databag']` - the databag containing hostescalations to search for. defaults to nagios_hostescalations
|
129
|
+
- `node['nagios']['contacts_databag']` - the databag containing contacts to search for. defaults to nagios_contacts
|
130
|
+
- `node['nagios']['contactgroups_databag']` - the databag containing contactgroups to search for. defaults to nagios_contactgroups
|
131
|
+
- `node['nagios']['servicedependencies_databag']` - the databag containing servicedependencies to search for. defaults to nagios_servicedependencies
|
132
|
+
- `node['nagios']['host_name_attribute']` - node attribute to use for naming the host. Must be unique across monitored nodes. Defaults to hostname
|
133
|
+
- `node['nagios']['regexp_matching']` - Attribute to enable [regexp matching](http://nagios.sourceforge.net/docs/3_0/configmain.html#use_regexp_matching). Defaults to 0.
|
134
|
+
- `node['nagios']['templates']` - These set directives in the default host template. Unless explicitly overridden, they will be inherited by the host definitions for each discovered node and `nagios_unmanagedhosts` data bag. For more information about these directives, see the Nagios documentation for [host definitions](http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#host).
|
135
|
+
- `node['nagios']['hosts_template']` - Host template you want to inherit properties/variables from, default 'server'. For more information, see the nagios doc on [Object Inheritance](http://nagios.sourceforge.net/docs/3_0/objectinheritance.html).
|
136
|
+
- `node['nagios']['brokers']` - Hash of broker modules to include in the config. Hash key is the path to the broker module, the value is any parameters to pass to it.
|
137
|
+
- `node['nagios']['nagios_config']['template_cookbook']` - Look for template file in the cookbook mentioned in the attribute. Defaults to nagios
|
138
|
+
- `node['nagios']['resources']['template_cookbook']` - Look for template file in the cookbook mentioned in the attribute. Defaults to nagios
|
139
|
+
- `node['nagios']['htauth']['template_cookbook']` - Look for template file in the cookbook mentioned in the attribute. Defaults to nagios
|
140
|
+
- `node['nagios']['nagios_config']['template_file']` - Template file to be rendered. Defaults to nagios.cfg.erb
|
141
|
+
- `node['nagios']['resources']['template_file']` - Template file to be rendered. Defaults to resource.cfg.erb
|
142
|
+
- `node['nagios']['htauth']['template_file']` - Template file to be rendered. Defaults to htpasswd.users.erb
|
143
|
+
|
144
|
+
- `node['nagios']['default_host']['flap_detection']` - Defaults to `true`.
|
145
|
+
- `node['nagios']['default_host']['process_perf_data']` - Defaults to `false`.
|
146
|
+
- `node['nagios']['default_host']['check_period']` - Defaults to `'24x7'`.
|
147
|
+
- `node['nagios']['default_host']['check_interval']` - In seconds. Must be divisible by `node['nagios']['interval_length']`. Defaults to `15`.
|
148
|
+
- `node['nagios']['default_host']['retry_interval']` - In seconds. Must be divisible by `node['nagios']['interval_length']`. Defaults to `15`.
|
149
|
+
- `node['nagios']['default_host']['max_check_attempts']` - Defaults to `1`.
|
150
|
+
- `node['nagios']['default_host']['check_command']` - Defaults to the pre-defined command `'check-host-alive'`.
|
151
|
+
- `node['nagios']['default_host']['notification_interval']` - In seconds. Must be divisible by `node['nagios']['interval_length']`. Defaults to `300`.
|
152
|
+
- `node['nagios']['default_host']['notification_options']` - Defaults to `'d,u,r'`.
|
153
|
+
- `node['nagios']['default_host']['action_url']` - Defines a action url. Defaults to `nil`.
|
154
|
+
|
155
|
+
- `node['nagios']['default_service']['process_perf_data']` - Defaults to `false`.
|
156
|
+
- `node['nagios']['default_service']['action_url']` - Defines a action url. Defaults to `nil`.
|
157
|
+
|
158
|
+
- `node['nagios']['server']['web_server']` - web server to use. supports Apache or Nginx, default "apache"
|
159
|
+
- `node['nagios']['server']['nginx_dispatch']` - nginx dispatch method. supports cgi or php, default "cgi"
|
160
|
+
- `node['nagios']['server']['stop_apache']` - stop apache service if using nginx, default false
|
161
|
+
- `node['nagios']['server']['redirect_root']` - if using Apache, should `http://server/` redirect to `http://server/nagios3` automatically, default false
|
162
|
+
- `node['nagios']['server']['normalize_hostname']` - If set to true, normalize all hostnames in hosts.cfg to lowercase. Defaults to false.
|
163
|
+
|
164
|
+
These are nagios cgi.config options.
|
165
|
+
|
166
|
+
- `node['nagios']['cgi']['show_context_help']` - Defaults to 1
|
167
|
+
- `node['nagios']['cgi']['authorized_for_system_information']` - Defaults to '-'
|
168
|
+
- `node['nagios']['cgi']['authorized_for_configuration_information']` - Defaults to '-'
|
169
|
+
- `node['nagios']['cgi']['authorized_for_system_commands']` - Defaults to '-'
|
170
|
+
- `node['nagios']['cgi']['authorized_for_all_services']` - Defaults to '-'
|
171
|
+
- `node['nagios']['cgi']['authorized_for_all_hosts']` - Defaults to '-'
|
172
|
+
- `node['nagios']['cgi']['authorized_for_all_service_commands']` - Defaults to '-'
|
173
|
+
- `node['nagios']['cgi']['authorized_for_all_host_commands']` - Defaults to '-'
|
174
|
+
- `node['nagios']['cgi']['default_statusmap_layout']` - Defaults to 5
|
175
|
+
- `node['nagios']['cgi']['default_statuswrl_layout']` - Defaults to 4
|
176
|
+
- `node['nagios']['cgi']['result_limit']` - Defaults to 100
|
177
|
+
- `node['nagios']['cgi']['escape_html_tags']` - Defaults to 0
|
178
|
+
- `node['nagios']['cgi']['action_url_target']` - Defaults to '_blank'
|
179
|
+
- `node['nagios']['cgi']['notes_url_target']` - Defaults to '_blank'
|
180
|
+
- `node['nagios']['cgi']['lock_author_names']` - Defaults to 1
|
181
|
+
- `node['nagios']['cgi']['template_cookbook']` - Look for template file in the cookbook mentioned in the attribute. Defaults to nagios
|
182
|
+
- `node['nagios']['cgi']['template_file']` - Template file to be rendered. Defaults to cgi.cfg.erb
|
183
|
+
|
184
|
+
## Recipes
|
185
|
+
|
186
|
+
### default recipe
|
187
|
+
|
188
|
+
Includes the correct client installation recipe based on platform, either `nagios::server_package` or `nagios::server_source`.
|
189
|
+
|
190
|
+
The server recipe sets up Apache as the web front end by default. This recipe also does a number of searches to dynamically build the hostgroups to monitor, hosts that belong to them and admins to notify of events/alerts.
|
191
|
+
|
192
|
+
Searches are confined to the node's `chef_environment` unless multi-environment monitoring is enabled.
|
193
|
+
|
194
|
+
The recipe does the following:
|
195
|
+
|
196
|
+
1. Searches for users in 'users' databag belonging to a 'sysadmin' group, and authorizes them to access the Nagios web UI and also to receive notification e-mails.
|
197
|
+
1. Searches all available roles/environments and builds a list which will become the Nagios hostgroups.
|
198
|
+
1. Places nodes in Nagios hostgroups by role / environment membership.
|
199
|
+
1. Installs various packages required for the server.
|
200
|
+
1. Sets up configuration directories.
|
201
|
+
1. Moves the package-installed Nagios configuration to a 'dist' directory.
|
202
|
+
1. Disables the 000-default VirtualHost present on Debian/Ubuntu Apache2 package installations.
|
203
|
+
1. Templates configuration files for services, contacts, contact groups, templates, hostgroups and hosts.
|
204
|
+
1. Enables the Nagios web UI.
|
205
|
+
1. Starts the Nagios server service
|
206
|
+
|
207
|
+
### server_package
|
208
|
+
|
209
|
+
Installs the Nagios server from packages. Default for Debian / Ubuntu systems.
|
210
|
+
|
211
|
+
### server_source
|
212
|
+
|
213
|
+
Installs the Nagios server from source. Default for Red Hat based systems as native packages for Nagios are not available in the default repositories.
|
214
|
+
|
215
|
+
### pagerduty
|
216
|
+
|
217
|
+
Installs pagerduty plugin for nagios. If you only have a single pagerduty key, you can simply set a `node['nagios']['pagerduty_key']` attribute on your server. For multiple pagerduty key configuration see Pager Duty under Data Bags.
|
218
|
+
|
219
|
+
This recipe was written based on the [Nagios Integration Guide](http://www.pagerduty.com/docs/guides/nagios-integration-guide) from PagerDuty which explains how to get an API key for your Nagios server.
|
220
|
+
|
221
|
+
## Data Bags
|
222
|
+
|
223
|
+
[See Wiki for more databag information](https://github.com/sous-chefs/nagios/wiki/config)
|
224
|
+
|
225
|
+
### Pager Duty
|
226
|
+
|
227
|
+
You can define pagerduty contacts and keys by creating nagios_pagerduty data bags that contain the contact and the relevant key. Setting admin_contactgroup to "true" will add this pagerduty contact to the admin contact group created by this cookbook.
|
228
|
+
|
229
|
+
```javascript
|
230
|
+
{
|
231
|
+
"id": "pagerduty_critical",
|
232
|
+
"admin_contactgroup": "true",
|
233
|
+
"key": "a33e5ef0ac96772fbd771ddcccd3ccd0"
|
234
|
+
}
|
235
|
+
```
|
236
|
+
|
237
|
+
You can add these contacts to any contactgroups you create.
|
238
|
+
|
239
|
+
## Monitoring Role
|
240
|
+
|
241
|
+
Create a role to use for the monitoring server. The role name should match the value of the attribute "`node['nrpe']['server_role']`" on your clients. By default, this is '`monitoring`'. For example:
|
242
|
+
|
243
|
+
```ruby
|
244
|
+
# roles/monitoring.rb
|
245
|
+
name 'monitoring'
|
246
|
+
description 'Monitoring server'
|
247
|
+
run_list(
|
248
|
+
'recipe[nagios::default]'
|
249
|
+
)
|
250
|
+
|
251
|
+
default_attributes(
|
252
|
+
'nagios' => {
|
253
|
+
'server_auth_method' => 'htauth'
|
254
|
+
}
|
255
|
+
)
|
256
|
+
```
|
257
|
+
|
258
|
+
```bash
|
259
|
+
knife role from file monitoring.rb
|
260
|
+
```
|
261
|
+
|
262
|
+
## Usage
|
263
|
+
|
264
|
+
### server setup
|
265
|
+
|
266
|
+
Create a role named '`monitoring`', and add the nagios server recipe to the `run_list`. See --Monitoring Role-- above for an example.
|
267
|
+
|
268
|
+
Apply the nrpe cookbook to nodes in order to install the NRPE client
|
269
|
+
|
270
|
+
By default the Nagios server will only monitor systems in its same environment. To change this set the `multi_environment_monitoring` attribute. See --Attributes--
|
271
|
+
|
272
|
+
Create data bag items in the `users` data bag for each administer you would like to be able to login to the Nagios server UI. Pay special attention to the method you would like to use to authorization users (openid or htauth). See --Users-- and --Atttributes--
|
273
|
+
|
274
|
+
At this point you now have a minimally functional Nagios server, however the server will lack any service checks outside of the single Nagios Server health check.
|
275
|
+
|
276
|
+
### defining checks
|
277
|
+
|
278
|
+
NRPE commands are defined in recipes using the nrpe_check LWRP provider in the nrpe cookbooks. For base system monitoring such as load, ssh, memory, etc you may want to create a cookbook in your environment that defines each monitoring command via the LWRP.
|
279
|
+
|
280
|
+
With NRPE commands created using the LWRP you will need to define Nagios services to use those commands. These services are defined using the `nagios_services` data bag and applied to roles and/or environments. See --Services--
|
281
|
+
|
282
|
+
### enabling notifications
|
283
|
+
|
284
|
+
You need to set `default['nagios']['notifications_enabled'] = 1` attribute on your Nagios server to enable email notifications.
|
285
|
+
|
286
|
+
For email notifications to work an appropriate mail program package and local MTA need to be installed so that /usr/bin/mail or /bin/mail is available on the system.
|
287
|
+
|
288
|
+
Example:
|
289
|
+
|
290
|
+
Include [postfix cookbook](https://github.com/opscode-cookbooks/postfix) to be installed on your Nagios server node.
|
291
|
+
|
292
|
+
Add override_attributes to your `monitoring` role:
|
293
|
+
|
294
|
+
```ruby
|
295
|
+
# roles/monitoring.rb
|
296
|
+
name 'monitoring'
|
297
|
+
description 'Monitoring Server'
|
298
|
+
run_list(
|
299
|
+
'recipe[nagios:default]',
|
300
|
+
'recipe[postfix]'
|
301
|
+
)
|
302
|
+
|
303
|
+
override_attributes(
|
304
|
+
'nagios' => { 'notifications_enabled' => '1' },
|
305
|
+
'postfix' => { 'myhostname':'your_hostname', 'mydomain':'example.com' }
|
306
|
+
)
|
307
|
+
|
308
|
+
default_attributes(
|
309
|
+
'nagios' => { 'server_auth_method' => 'htauth' }
|
310
|
+
)
|
311
|
+
```
|
312
|
+
|
313
|
+
```bash
|
314
|
+
knife role from file monitoring.rb
|
315
|
+
```
|
316
|
+
|
317
|
+
## Contributors
|
318
|
+
|
319
|
+
This project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false)
|
320
|
+
|
321
|
+
### Backers
|
322
|
+
|
323
|
+
Thank you to all our backers!
|
324
|
+
|
325
|
+

|
326
|
+
|
327
|
+
### Sponsors
|
328
|
+
|
329
|
+
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
|
330
|
+
|
331
|
+

|
332
|
+

|
333
|
+

|
334
|
+

|
335
|
+

|
336
|
+

|
337
|
+

|
338
|
+

|
339
|
+

|
340
|
+

|