Merge branch 'jenkins' into 'master'

Jenkins

See merge request !49
This commit is contained in:
12ww1160
2017-07-25 19:47:28 +02:00
25 changed files with 897 additions and 76 deletions

View File

@@ -8,6 +8,16 @@ Changelog of Git Changelog.
<h2> No issue </h2>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/445db500b3ab876">445db500b3ab876</a> Jenkins Server <i>2017-07-25 16:15:39</i>
<p>
<h3>recommit for updates in build 92</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/b4e4ceb9b07cde4">b4e4ceb9b07cde4</a> Arne Teuke <i>2017-07-25 16:15:21</i>
<p>
<h3>added parameter documentation</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/a3517b81e663a07">a3517b81e663a07</a> Jenkins Server <i>2017-07-25 16:13:43</i>
<p>
<h3>recommit for updates in build 91</h3>

View File

@@ -201,7 +201,7 @@
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:29 2017 by
Generated on Tue Jul 25 19:56:29 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -338,7 +338,7 @@ environments.</p>
</div></div>
<div id="footer">
Generated on Tue Jul 25 18:15:31 2017 by
Generated on Tue Jul 25 19:56:31 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -338,7 +338,7 @@ environments.</p>
</div></div>
<div id="footer">
Generated on Tue Jul 25 18:15:30 2017 by
Generated on Tue Jul 25 19:56:30 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -139,7 +139,7 @@ class cd_nagios {
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:31 2017 by
Generated on Tue Jul 25 19:56:31 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -230,7 +230,7 @@ class cd_nagios::certbot::certs (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -368,7 +368,7 @@ class cd_nagios::client::target (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -207,7 +207,7 @@ class cd_nagios::firewall::iptables (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -195,7 +195,7 @@ class cd_nagios::main::config (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -468,7 +468,7 @@ class cd_nagios::main::dirs (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:34 2017 by
Generated on Tue Jul 25 19:56:34 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -235,7 +235,7 @@ class cd_nagios::main::install (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -200,7 +200,7 @@ class cd_nagios::main::user (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:34 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -595,7 +595,7 @@ class cd_nagios::nagios::objects::commands (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -115,8 +115,7 @@ for more details.</p>
<p>You should have received a copy of the GNU General Public License
along
with this program. If not, see <a
href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.
}</p>
href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
</div>
</div>
@@ -127,10 +126,12 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.
<p class="example_title"><div class='inline'>
<p>cd_nagios::objects::templates { $name:</p>
<p>cd_nagios::nagios::objects::templates { &#39;generic contact&#39;:</p>
</div></p>
<pre class="example code"><code>ng_template_object =&gt; &#39;service&#39;,</code></pre>
<pre class="example code"><code>ng_template_object =&gt; &#39;contact&#39;,
ng_template_object_name =&gt; &#39;generic-contact&#39;,
}</code></pre>
</div>
@@ -142,7 +143,6 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.
<pre class="lines">
26
27
28
29
@@ -170,10 +170,38 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.
51
52
53
54</pre>
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/nagios/objects/template_rules.pp', line 26</span>
<pre class="code"><span class="info file"># File 'manifests/nagios/objects/template_rules.pp', line 27</span>
class cd_nagios::nagios::objects::template_rules (
@@ -197,11 +225,38 @@ class cd_nagios::nagios::objects::template_rules (
notify =&gt; Service[$ng_service],
}
# example rule
cd_nagios::objects::templates { &#39;generic contact&#39;:
# basic templates
cd_nagios::nagios::objects::templates { &#39;generic contact&#39;:
ng_template_object =&gt; &#39;contact&#39;,
ng_template_object_name =&gt; &#39;generic-contact&#39;,
}
cd_nagios::nagios::objects::templates { &#39;generic-host&#39;:
ng_template_object =&gt; &#39;host&#39;,
ng_template_object_name =&gt; &#39;generic-host&#39;,
}
cd_nagios::nagios::objects::templates { &#39;linux-server&#39;:
ng_template_object =&gt; &#39;host&#39;,
ng_template_object_name =&gt; &#39;linux-server&#39;,
ng_template_object_use =&gt; &#39;generic-host&#39;,
ng_notification_options =&gt; &#39;d,u,r&#39;,
}
cd_nagios::nagios::objects::templates { &#39;windows-server&#39;:
ng_template_object =&gt; &#39;host&#39;,
ng_template_object_name =&gt; &#39;windows-server&#39;,
ng_template_object_use =&gt; &#39;generic-host&#39;,
ng_notification_options =&gt; &#39;d,u,r&#39;,
}
cd_nagios::nagios::objects::templates { &#39;generic-service&#39;:
ng_template_object =&gt; &#39;service&#39;,
ng_template_object_name =&gt; &#39;generic-service&#39;,
ng_max_check_attempts =&gt; &#39;3&#39;,
ng_notification_options =&gt; &#39;w,u,c,r&#39;,
}
cd_nagios::nagios::objects::templates { &#39;local-service&#39;:
ng_template_object =&gt; &#39;service&#39;,
ng_template_object_name =&gt; &#39;generic-service&#39;,
ng_max_check_attempts =&gt; &#39;4&#39;,
}
}
}</pre>
</td>
@@ -211,7 +266,7 @@ class cd_nagios::nagios::objects::template_rules (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:36 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -5557,7 +5557,7 @@ $ng_target_command = &quot;${ng_conf_d_dir}/nagios_command.cfg&quot;
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:34 2017 by
Generated on Tue Jul 25 19:56:34 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -249,7 +249,7 @@ class cd_nagios::selinux::config (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -195,7 +195,7 @@ class cd_nagios::server::access_rules (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -334,7 +334,7 @@ class cd_nagios::server::files (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -270,7 +270,7 @@ class cd_nagios::server::service (
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:35 2017 by
Generated on Tue Jul 25 19:56:35 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -108,7 +108,9 @@ for more details.</p>
<p>You should have received a copy of the GNU General Public License
along
with this program. If not, see <a
href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.
notifications.
for the defined service or host.</p>
</div>
</div>
@@ -130,7 +132,7 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
&mdash;
<div class='inline'>
<p>the object type for the templates.
valid options are <code>contact</code>,
Valid options are <code>contact</code>,
<code>host</code> and <code>service</code>.</p>
</div>
@@ -247,7 +249,7 @@ r = notify on host
recoveries (UP states),
f = notify when the host starts and stops
flapping,
s = snotify when host or service scheduled downtime starts and
s = notify when host or service scheduled downtime starts and
ends.
n = none (the contact will not receive any type of host
notifications).</p>
@@ -315,6 +317,478 @@ definition, we do not want to register those.</p>
</li>
<li>
<span class='name'>ng_template_object_use</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>undef</tt>)</em>
&mdash;
<div class='inline'>
<p>Which template to use for a given
host or service definition, i.e.
<code>generic-host</code>, <code>generic-service</code> etc.</p>
</div>
</li>
<li>
<span class='name'>ng_notifications_enabled</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether notifications are enabled.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_event_handler_enabled</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether event handlers are enabled.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_flap_detection_enabled</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether flap detection is enabled.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_failure_prediction_enabled</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether failure prediction is
enabled. Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_process_perf_data</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to process performance data.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_retain_status_information</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to retain status
information. Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_retain_nonstatus_information</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to retain non-status
information. Valid options are <code>0</code>
and <code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_notification_period</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;24x7&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Which period in to send out</p>
</div>
</li>
<li>
<span class='name'>ng_notification_interval</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;30&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whoe often (in minutes) we should
resend notifications for the current
status.</p>
</div>
</li>
<li>
<span class='name'>ng_check_period</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;24x7&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Which period in to run checks for the defined
object.</p>
</div>
</li>
<li>
<span class='name'>ng_check_interval</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;5&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>How often in minutes to check the defined
object.</p>
</div>
</li>
<li>
<span class='name'>ng_retry_interval</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>at what interval in minutes to schedule
retries for the defined object.</p>
</div>
</li>
<li>
<span class='name'>ng_max_check_attempts</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;10&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>how often to check the defined object
maximal.</p>
</div>
</li>
<li>
<span class='name'>ng_notification_options</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>undef</tt>)</em>
&mdash;
<div class='inline'>
<p>see <code>ng_service_notification_options</code>
and
<code>ng_host_notification_options</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_contact_groups</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;admins&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>contact groups for the defined oject.
Specified contact group must exit in
contact_groups</p>
</div>
</li>
<li>
<span class='name'>ng_active_checks_enabled</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to enable active checks.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_passive_checks_enabled</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to enable passive checks.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_parallelize_check</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to parallelize checks
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_obsess_over_service</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to obsess over the service.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_check_freshness</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;0&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to check freshness.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_is_volatile</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;0&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether the service is volatile.
Valid options are <code>0</code> and
<code>1</code>.</p>
</div>
</li>
<li>
<span class='name'>ng_normal_check_interval</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;10&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>How often to check the service
under normal conditions.</p>
</div>
</li>
<li>
<span class='name'>ng_retry_check_interval</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;2&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Re-check the service every x minutes
until a hard state can be determined.</p>
</div>
</li>
<li>
<span class='name'>ng_host_notification_period</span>
@@ -328,6 +802,19 @@ definition, we do not want to register those.</p>
</li>
<li>
<span class='name'>ng_check_command</span>
<span class='type'>(<tt>Any</tt>)</span>
<em class="default">(defaults to: <tt>&#39;check-host-alive&#39;</tt>)</em>
</li>
</ul>
@@ -338,33 +825,59 @@ definition, we do not want to register those.</p>
<pre class="lines">
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76</pre>
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/nagios/objects/templates.pp', line 53</span>
<pre class="code"><span class="info file"># File 'manifests/nagios/objects/templates.pp', line 101</span>
define cd_nagios::nagios::objects::templates (
$ng_template_object = undef,
@@ -376,6 +889,32 @@ $ng_host_notification_options = &#39;d,u,r,f,s&#39;,
$ng_service_notification_commands = &#39;notify-service-by-email&#39;,
$ng_host_notification_commands = &#39;notify-host-by-email&#39;,
$ng_object_register = &#39;0&#39;,
$ng_template_object_use = undef,
$ng_notifications_enabled = &#39;1&#39;,
$ng_event_handler_enabled = &#39;1&#39;,
$ng_flap_detection_enabled = &#39;1&#39;,
$ng_failure_prediction_enabled = &#39;1&#39;,
$ng_process_perf_data = &#39;1&#39;,
$ng_retain_status_information = &#39;1&#39;,
$ng_retain_nonstatus_information = &#39;1&#39;,
$ng_notification_period = &#39;24x7&#39;,
$ng_notification_interval = &#39;30&#39;,
$ng_check_period = &#39;24x7&#39;,
$ng_check_interval = &#39;5&#39;,
$ng_retry_interval = &#39;1&#39;,
$ng_max_check_attempts = &#39;10&#39;,
$ng_check_command = &#39;check-host-alive&#39;,
$ng_notification_options = undef,
$ng_contact_groups = &#39;admins&#39;,
$ng_active_checks_enabled = &#39;1&#39;,
$ng_passive_checks_enabled = &#39;1&#39;,
$ng_parallelize_check = &#39;1&#39;,
$ng_obsess_over_service = &#39;1&#39;,
$ng_check_freshness = &#39;0&#39;,
$ng_is_volatile = &#39;0&#39;,
$ng_normal_check_interval = &#39;10&#39;,
$ng_retry_check_interval = &#39;2&#39;,
) {
$ng_nagios_server = $::cd_nagios::params::ng_nagios_server
@@ -397,7 +936,7 @@ $ng_templates_rule_erb = $::cd_nagios::params::ng_templates_rule_erb
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:36 2017 by
Generated on Tue Jul 25 19:56:36 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -220,7 +220,7 @@ $ng_service = $::cd_nagios::params::ng_service
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:36 2017 by
Generated on Tue Jul 25 19:56:36 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -90,7 +90,7 @@
</div>
<div id="footer">
Generated on Tue Jul 25 18:15:31 2017 by
Generated on Tue Jul 25 19:56:31 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -19,8 +19,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# @summary Class manages /etc/nagios/conf.d/templates.cfg through concat.
# @example cd_nagios::objects::templates { $name:
# ng_template_object => 'service',
# @example cd_nagios::nagios::objects::templates { 'generic contact':
# ng_template_object => 'contact',
# ng_template_object_name => 'generic-contact',
# }
################################################################################
class cd_nagios::nagios::objects::template_rules (
@@ -45,10 +46,37 @@ class cd_nagios::nagios::objects::template_rules (
notify => Service[$ng_service],
}
# example rule
cd_nagios::objects::templates { 'generic contact':
# basic templates
cd_nagios::nagios::objects::templates { 'generic contact':
ng_template_object => 'contact',
ng_template_object_name => 'generic-contact',
}
cd_nagios::nagios::objects::templates { 'generic-host':
ng_template_object => 'host',
ng_template_object_name => 'generic-host',
}
cd_nagios::nagios::objects::templates { 'linux-server':
ng_template_object => 'host',
ng_template_object_name => 'linux-server',
ng_template_object_use => 'generic-host',
ng_notification_options => 'd,u,r',
}
cd_nagios::nagios::objects::templates { 'windows-server':
ng_template_object => 'host',
ng_template_object_name => 'windows-server',
ng_template_object_use => 'generic-host',
ng_notification_options => 'd,u,r',
}
cd_nagios::nagios::objects::templates { 'generic-service':
ng_template_object => 'service',
ng_template_object_name => 'generic-service',
ng_max_check_attempts => '3',
ng_notification_options => 'w,u,c,r',
}
cd_nagios::nagios::objects::templates { 'local-service':
ng_template_object => 'service',
ng_template_object_name => 'generic-service',
ng_max_check_attempts => '4',
}
}
}

View File

@@ -20,7 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# @summary Define manages populates /etc/nagios/conf.d/templates.cfg.
# @param [string] ng_template_object the object type for the templates.
# valid options are `contact`, `host` and `service`.
# Valid options are `contact`, `host` and `service`.
# @param [string] ng_template_object_name populates the name field,
# i.e. `generic-contact`, `generic-host`, `generic-service`.
# @param [string] ng_svc_notification_period Period in which to send out
@@ -41,7 +41,7 @@
# u = notify on UNREACHABLE host states,
# r = notify on host recoveries (UP states),
# f = notify when the host starts and stops flapping,
# s = snotify when host or service scheduled downtime starts and ends.
# s = notify when host or service scheduled downtime starts and ends.
# n = none (the contact will not receive any type of host notifications).
# @param [string] ng_service_notification_commands Command to use for
# service event notification. Command must be defined in commands.cfg
@@ -49,6 +49,54 @@
# host event notification. Command must be defined in commands.cfg.
# @param [string] ng_object_register Whether to register the object to Nagios.
# Since this is a template definition, we do not want to register those.
# @param [string] ng_template_object_use Which template to use for a given
# host or service definition, i.e. `generic-host`, `generic-service` etc.
# @param [string] ng_notifications_enabled Whether notifications are enabled.
# Valid options are `0` and `1`.
# @param [string] ng_event_handler_enabled Whether event handlers are enabled.
# Valid options are `0` and `1`.
# @param [string] ng_flap_detection_enabled Whether flap detection is enabled.
# Valid options are `0` and `1`.
# @param [string] ng_failure_prediction_enabled Whether failure prediction is
# enabled. Valid options are `0` and `1`.
# @param [string] ng_process_perf_data Whether to process performance data.
# Valid options are `0` and `1`.
# @param [string] ng_retain_status_information Whether to retain status
# information. Valid options are `0` and `1`.
# @param [string] ng_retain_nonstatus_information Whether to retain non-status
# information. Valid options are `0` and `1`.
# @param [string] ng_notification_period Which period in to send out
# notifications. for the defined service or host.
# @param [string] ng_notification_interval Whoe often (in minutes) we should
# resend notifications for the current status.
# @param [string] ng_check_period Which period in to run checks for the defined
# object.
# @param [string] ng_check_interval How often in minutes to check the defined
# object.
# @param [string] ng_retry_interval at what interval in minutes to schedule
# retries for the defined object.
# @param [string] ng_max_check_attempts how often to check the defined object
# maximal.
# @param [string] ng_notification_options see `ng_service_notification_options`
# and `ng_host_notification_options`.
# @param [string] ng_contact_groups contact groups for the defined oject.
# Specified contact group must exit in contact_groups
# @param [string] ng_active_checks_enabled Whether to enable active checks.
# Valid options are `0` and `1`.
# @param [string] ng_passive_checks_enabled Whether to enable passive checks.
# Valid options are `0` and `1`.
# @param [string] ng_parallelize_check Whether to parallelize checks
# Valid options are `0` and `1`.
# @param [string] ng_obsess_over_service Whether to obsess over the service.
# Valid options are `0` and `1`.
# @param [string] ng_check_freshness Whether to check freshness.
# Valid options are `0` and `1`.
# @param [string] ng_is_volatile Whether the service is volatile.
# Valid options are `0` and `1`.
# @param [string] ng_normal_check_interval How often to check the service
# under normal conditions.
# @param [string] ng_retry_check_interval Re-check the service every x minutes
# until a hard state can be determined.
################################################################################
define cd_nagios::nagios::objects::templates (
$ng_template_object = undef,
@@ -60,6 +108,32 @@ $ng_host_notification_options = 'd,u,r,f,s',
$ng_service_notification_commands = 'notify-service-by-email',
$ng_host_notification_commands = 'notify-host-by-email',
$ng_object_register = '0',
$ng_template_object_use = undef,
$ng_notifications_enabled = '1',
$ng_event_handler_enabled = '1',
$ng_flap_detection_enabled = '1',
$ng_failure_prediction_enabled = '1',
$ng_process_perf_data = '1',
$ng_retain_status_information = '1',
$ng_retain_nonstatus_information = '1',
$ng_notification_period = '24x7',
$ng_notification_interval = '30',
$ng_check_period = '24x7',
$ng_check_interval = '5',
$ng_retry_interval = '1',
$ng_max_check_attempts = '10',
$ng_check_command = 'check-host-alive',
$ng_notification_options = undef,
$ng_contact_groups = 'admins',
$ng_active_checks_enabled = '1',
$ng_passive_checks_enabled = '1',
$ng_parallelize_check = '1',
$ng_obsess_over_service = '1',
$ng_check_freshness = '0',
$ng_is_volatile = '0',
$ng_normal_check_interval = '10',
$ng_retry_check_interval = '2',
) {
$ng_nagios_server = $::cd_nagios::params::ng_nagios_server

View File

@@ -1,18 +1,133 @@
<% if @ng_template_object == 'contact' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %> ;
service_notification_period <%= @ng_svc_notification_period %> ;
host_notification_period <%= @ng_host_notification_period %> ;
service_notification_options <%= @ng_service_notification_options %> ;
host_notification_options <%= @ng_host_notification_options %> ;
service_notification_commands <%= @ng_service_notification_commands %> ;
host_notification_commands <%= @ng_host_notification_commands %> ;
register <%= @ng_object_register %> ;
name <%= @ng_template_object_name %>
service_notification_period <%= @ng_svc_notification_period %>
host_notification_period <%= @ng_host_notification_period %>
service_notification_options <%= @ng_service_notification_options %>
host_notification_options <%= @ng_host_notification_options %>
service_notification_commands <%= @ng_service_notification_commands %>
host_notification_commands <%= @ng_host_notification_commands %>
register <%= @ng_object_register %>
}
<% elsif @ng_template_object == 'host' -%>
<% elsif @ng_template_object == 'service' -%>
<% if @ng_template_object_name == 'generic-host' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %>
notifications_enabled <%= @ng_notifications_enabled %>
event_handler_enabled <%= @ng_event_handler_enabled %>
flap_detection_enabled <%= @ng_flap_detection_enabled %>
failure_prediction_enabled <%= @ng_failure_prediction_enabled %>
process_perf_data <%= @ng_process_perf_data %>
retain_status_information <%= @ng_retain_status_information %>
retain_nonstatus_information <%= @ng_retain_nonstatus_information %>
notification_period <%= @ng_notification_period %>
register <%= @ng_object_register %>
}
<% end -%>
<% if @ng_template_object_name == 'linux-server' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %>
use <%= @ng_template_object_use %>
check_period <%= @ng_check_period %>
check_interval <%= @ng_check_interval %>
retry_interval <%= @ng_retry_interval %>
max_check_attempts <%= @ng_ng_max_check_attempts %>
check_command <%= @ng_check_command %>
notification_period <%= @ng_notification_period %>
notification_interval <%= @ng_notification_interval %>
notification_options <%= @ng_notification_options %>
contact_groups <%= @ng_contact_groups %>
hostgroups linux-servers
register <%= @ng_object_register %>
}
<% end %>
<% if @ng_template_object_name == 'windows-server' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %>
use <%= @ng_template_object_use %>
check_period <%= @ng_check_period %>
check_interval <%= @ng_check_interval %>
retry_interval <%= @ng_retry_interval %>
max_check_attempts <%= @ng_max_check_attempts %>
check_command <%= @ng_check_command %>
notification_period <%= @ng_notification_period %>
notification_interval <%= @ng_notification_interval %>
notification_options <%= @ng_notification_options %>
contact_groups <%= @ng_contact_groups %>
hostgroups windows-servers
register <%= @ng_object_register %>
}
<% end %>
<% if @ng_template_object_name == 'generic_printer' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %>
use <%= @ng_template_object_use %>
check_period <%= @ng_check_period %>
check_interval <%= @ng_check_interval %>
retry_interval <%= @ng_retry_interval %>
max_check_attempts <%= @ng_max_check_attempts %>
check_command <%= @ng_check_command %>
notification_period <%= @ng_notification_period %>
notification_interval <%= @ng_notification_interval %>
notification_options <%= @ng_notification_options %>
contact_groups <%= @ng_contact_groups %>
statusmap_image printer.png
register <%= @ng_object_register %>
}
<% end %>
<% if @ng_template_object_name == 'generic_switch' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %>
use <%= @ng_template_object_use %>
check_period <%= @ng_check_period %>
check_interval <%= @ng_check_interval %>
retry_interval <%= @ng_retry_interval %>
max_check_attempts <%= @ng_max_check_attempts %>
check_command <%= @ng_check_command %>
notification_period <%= @ng_notification_period %>
notification_interval <%= @ng_notification_interval %>
notification_options <%= @ng_notification_options %>
contact_groups <%= @ng_contact_groups %>
statusmap_image switch.png
register <%= @ng_object_register %>
}
<% end %>
<% elsif @ng_template_object == 'service' -%>
<% if @ng_template_object_name == 'generic-service' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %>
active_checks_enabled <%= @ng_active_checks_enabled %>
passive_checks_enabled <%= @ng_passive_checks_enabled %>
parallelize_check <%= @ng_parallelize_check %>
obsess_over_service <%= @ng_obsess_over_service %>
check_freshness <%= @ng_check_freshness %>
notifications_enabled <%= @ng_notifications_enabled %>
event_handler_enabled <%= @ng_event_handler_enabled %>
flap_detection_enabled <%= @ng_flap_detection_enabled %>
failure_prediction_enabled <%= @ng_failure_prediction_enabled %>
process_perf_data <%= @ng_process_perf_data %>
retain_status_information <%= @ng_retain_status_information %>
retain_nonstatus_information <%= @ng_retain_nonstatus_information %>
is_volatile <%= @ng_is_volatile %>
check_period <%= @ng_check_period %>
max_check_attempts <%= @ng_max_check_attempts %>
normal_check_interval <%= @ng_normal_check_interval %>
retry_check_interval <%= @ng_retry_check_interval %>
contact_groups <%= @ng_contact_groups %>
notification_interval <%= @ng_notification_interval %>
notification_period <%= @ng_notification_period %>
register <%= @ng_object_register %>
}
<% end -%>
<% if @ng_template_object_name == 'local-service' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %>
use <%= @ng_template_object_use %>
max_check_attempts <%= @ng_max_check_attempts %>
normal_check_interval <%= @ng_normal_check_interval %>
retry_check_interval <%= @ng_retry_check_interval %>
register <%= @ng_object_register %>
}
<% end -%>
<% end -%>