diff --git a/CHANGELOG.md b/CHANGELOG.md
index bbf0644..6e5ca02 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,16 @@ Changelog of Git Changelog.
No issue
+d47eab08c8360e0 Jenkins ConfDroid 2018-04-27 17:38:02
+
+
recommit for updates in build 3
+
+
+0c39f033733df08 Arne Teuke 2018-04-27 17:37:52
+
+
updates README and Jenkinsfile
+
+
6ed24bfbf588e73 Jenkins ConfDroid 2018-04-12 11:03:51
recommit for updates in build 2
diff --git a/REPOSTRUCTURE.md b/REPOSTRUCTURE.md
index 2538412..5d0ae8b 100644
--- a/REPOSTRUCTURE.md
+++ b/REPOSTRUCTURE.md
@@ -64,26 +64,29 @@
| | |-- install.pp
| | `-- user.pp
| |-- nagios
-| | `-- objects
-| | |-- add_contactgroups.pp
-| | |-- add_contactgroups_rules.pp
-| | |-- add_contact.pp
-| | |-- add_contact_rules.pp
-| | |-- add_hostgroup_rules.pp
-| | |-- add_hostgroups.pp
-| | |-- add_servicegroup_rules.pp
-| | |-- add_servicegroups.pp
-| | |-- add_timeperiod_rules.pp
-| | |-- add_timeperiods.pp
-| | |-- commands.pp
-| | |-- config.pp
-| | |-- contactgroups.pp
-| | |-- contacts.pp
-| | |-- hostgroups.pp
-| | |-- servicegroups.pp
-| | |-- template_rules.pp
-| | |-- templates.pp
-| | `-- timeperiods.pp
+| | |-- objects
+| | | |-- add_contactgroups.pp
+| | | |-- add_contactgroups_rules.pp
+| | | |-- add_contact.pp
+| | | |-- add_contact_rules.pp
+| | | |-- add_hostgroup_rules.pp
+| | | |-- add_hostgroups.pp
+| | | |-- add_servicegroup_rules.pp
+| | | |-- add_servicegroups.pp
+| | | |-- add_timeperiod_rules.pp
+| | | |-- add_timeperiods.pp
+| | | |-- commands.pp
+| | | |-- config.pp
+| | | |-- contactgroups.pp
+| | | |-- contacts.pp
+| | | |-- hostgroups.pp
+| | | |-- servicegroups.pp
+| | | |-- template_rules.pp
+| | | |-- templates.pp
+| | | `-- timeperiods.pp
+| | `-- resources
+| | |-- resource_df.pp
+| | `-- resource.pp
| |-- selinux
| | `-- config.pp
| |-- server
@@ -113,6 +116,8 @@
| | |-- hostgroups_cfg_rule.erb
| | |-- htpasswd_rule.erb
| | |-- nagios_cfg.erb
+| | |-- resource_cfg.erb
+| | |-- resource_cfg_rule.erb
| | |-- svcgroups_cfg_head.erb
| | |-- svcgroups_cfg_rule.erb
| | |-- templates_cfg_head.erb
@@ -135,4 +140,4 @@
|-- README.md
`-- REPOSTRUCTURE.md
-20 directories, 115 files
+21 directories, 119 files
diff --git a/doc/_index.html b/doc/_index.html
index 6468ce2..124f2af 100644
--- a/doc/_index.html
+++ b/doc/_index.html
@@ -173,6 +173,11 @@
+
+ cd_nagios::nagios::resources::resource
+
+
+
cd_nagios::params
@@ -248,6 +253,11 @@
+
+ cd_nagios::nagios::resources::resource_df
+
+
+
cd_nagios::server::access
diff --git a/doc/file.README.html b/doc/file.README.html
index aaa0884..1ca5318 100644
--- a/doc/file.README.html
+++ b/doc/file.README.html
@@ -184,7 +184,9 @@ define, to avoid having to alter the module code.
* configure forwarding
http to https including accesing the /nagios url directly (optional)
*
-manage TLS certificates through certbot (optional)
+manage TLS certificates through certbot (optional)
+* manage
+$user$ arguments in resource file via define
Service
* manage Nagios service on server
diff --git a/doc/index.html b/doc/index.html
index 587b580..fee55e6 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -184,7 +184,9 @@ define, to avoid having to alter the module code.
* configure forwarding
http to https including accesing the /nagios url directly (optional)
*
-manage TLS certificates through certbot (optional)
+manage TLS certificates through certbot (optional)
+* manage
+$user$ arguments in resource file via define
Service
* manage Nagios service on server
diff --git a/doc/puppet_class_list.html b/doc/puppet_class_list.html
index eddf87d..f647e7a 100644
--- a/doc/puppet_class_list.html
+++ b/doc/puppet_class_list.html
@@ -187,35 +187,42 @@
-
+
+
+
+
+
+
-
+
-
+
-
+
-
+
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource.html
new file mode 100644
index 0000000..8384790
--- /dev/null
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource.html
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+ Puppet Class: cd_nagios::nagios::resources::resource
+
+ — Documentation by YARD 0.9.12
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Puppet Class: cd_nagios::nagios::resources::resource
+
+
+
+ Inherits:
+ cd_nagios::params
+
+
+
+
+ Defined in:
+
+ manifests/nagios/resources/resource.pp
+
+
+
+
+
Summary
+ Class manages the resource config file header.
+
+
Overview
+
+
+
+
cd_nagios::nagios::resources::resource.pp
+Module name: cd_nagios
+Author:
+Arne Teuke (arne_teuke@ConfDroid.com)
+
+
License:
+
+
This file is part of cd_nagios.
+
+
cd_nagios is used for providing automatic configuration of Nagios
+
+Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com)
+ This program is
+free software: you can redistribute it and/or modify
+ it under the terms of
+the GNU General Public License as published by
+ the Free Software
+Foundation, either version 3 of the License, or
+ (at your option) any later
+version.
+
+
This program is distributed in the hope that it will be useful,
+ but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License
+for more details.
+
+
You should have received a copy of the GNU General Public License
+ along
+with this program. If not, see www.gnu.org/licenses /.
+ }
+
+
+
+
+
+
+
+
+
+
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+
+
+ # File 'manifests/nagios/resources/resource.pp', line 28
+
+class cd_nagios::nagios::resources::resource (
+
+) inherits cd_nagios::params {
+
+ if $fqdn == $ng_nagios_server {
+
+ concat { $ng_resource_file:
+ ensure => present,
+ owner => 'root',
+ group => $ng_user,
+ mode => '0640',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_etc_t,
+ seluser => system_u,
+ notify => Service[$ng_service],
+ }
+
+ concat::fragment { 'header':
+ target => $ng_resource_file,
+ content => template($ng_resource_erb),
+ order => '000',
+ }
+
+ # plugins rule
+
+ cd_nagios::nagios::resources::resource_df { 'user_rule_plugins':
+ ng_user_arg_name => 'user1',
+ ng_user_arg_value => '/usr/lib64/nagios/plugins',
+ ng_user_arg_comment => "Sets user1 to be the path to the plugins",
+ }
+
+ # eventhandlers rule
+ cd_nagios::nagios::resources::resource_df { 'user_rule_eventhandlers':
+ ng_user_arg_name => 'user2',
+ ng_user_arg_value => '/usr/lib64/nagios/plugins/eventhandlers',
+ ng_user_arg_comment => "Sets user2 to be the path to the eventhandlers",
+ }
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/puppet_classes/cd_nagios_3A_3Aparams.html b/doc/puppet_classes/cd_nagios_3A_3Aparams.html
index dee3179..3439709 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aparams.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aparams.html
@@ -97,6 +97,8 @@
cd_nagios::nagios::objects::hostgroups
+ cd_nagios::nagios::resources::resource
+
cd_nagios::nagios::objects::timeperiods
cd_nagios::nagios::objects::contactgroups
@@ -4915,6 +4917,42 @@ the check declaration from there, so the
Nagios check is properly aligned
to the Puppet module controlling the
particular item.
+
+
+
+
+
+
+ ng_user_arg1
+
+
+ (string )
+
+
+ (defaults to: '/usr/lib64/nagios/plugins' )
+
+
+ —
+
+
the user argument for $user1$
+
+
+
+
+
+
+ ng_user_arg2
+
+
+ (string )
+
+
+ (defaults to: '/usr/lib64/nagios/plugins/eventhandlers' )
+
+
+ —
+
+
the user argument for $user2$
@@ -4936,8 +4974,6 @@ particular item.
-653
-654
655
656
657
@@ -5295,10 +5331,16 @@ particular item.
1009
1010
1011
-1012
+1012
+1013
+1014
+1015
+1016
+1017
+1018
- # File 'manifests/params.pp', line 653
+ # File 'manifests/params.pp', line 655
class cd_nagios::params (
@@ -5554,6 +5596,9 @@ $ng_loadctl_options = 'jobs_max=100;backoff_limit=10;rampup_change=5
# single nagios checks
$ng_enable_swap_check = true,
+# resource.cfg
+$ng_user_arg1 = '/usr/lib64/nagios/plugins',
+$ng_user_arg2 = '/usr/lib64/nagios/plugins/eventhandlers',
) {
@@ -5614,6 +5659,7 @@ $ng_ssl_vhost_file = '/etc/httpd/conf.d/nagios_ssl.conf'
$ng_ssl_vhost_erb = 'cd_nagios/httpd/nagios_ssl_vhost.erb'
$ng_nagios_cfg_file = "${ng_main_dir}/nagios.cfg"
$ng_nagios_cfg_erb = 'cd_nagios/nagios/nagios_cfg.erb'
+$ng_resource_erb = 'cd_nagios/nagios/resource_cfg.erb'
# certbot
$ng_certbot_main_dir = '/etc/letsencrypt'
diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html
index eb986da..8b9de6e 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html
@@ -225,7 +225,26 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/.
116
117
118
-119
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
# File 'manifests/server/files.pp', line 23
@@ -277,6 +296,25 @@ class cd_nagios::server::files (
notify => Service[$ng_service],
}
+ # manage resources.cfg file
+
+ file { $ng_resource_file:
+ ensure => file,
+ path => $ng_resource_file,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ selrange => s0,
+ selrole => object_r,
+ seltype => nagios_etc_t,
+ seluser => system_u,
+ content => template($ng_cgi_cfg_erb),
+ notify => Service[$ng_service],
+ }
+
+
+
+ ## Apache files
# since we use vhost files, we do not want the regular file to appear
# after upgrades to avoid conflicts
diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
index 518764c..5a80826 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
@@ -324,7 +324,8 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/.
215
216
217
-218
+218
+219
# File 'manifests/server/service.pp', line 23
@@ -341,6 +342,7 @@ class cd_nagios::server::service (
require cd_nagios::server::files
require cd_nagios::server::access_rules
require cd_nagios::nagios::objects::config
+ require cd_nagios::nagios::resources::resource
service { $ng_service:
ensure => running,
@@ -349,7 +351,7 @@ class cd_nagios::server::service (
enable => true,
}
- @@nagios_host { 'localhost':
+ @@nagios_host { "localhost_${::hostname}":
ensure => $ng_ping_ensure,
alias => 'localhost',
address => '127.0.0.1',
diff --git a/doc/puppet_defined_type_list.html b/doc/puppet_defined_type_list.html
index c239511..77f8b72 100644
--- a/doc/puppet_defined_type_list.html
+++ b/doc/puppet_defined_type_list.html
@@ -82,7 +82,14 @@
-
+
+
+
+
+
+
diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource_df.html b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource_df.html
new file mode 100644
index 0000000..76b4dcd
--- /dev/null
+++ b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource_df.html
@@ -0,0 +1,246 @@
+
+
+
+
+
+
+ Defined Type: cd_nagios::nagios::resources::resource_df
+
+ — Documentation by YARD 0.9.12
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Defined Type: cd_nagios::nagios::resources::resource_df
+
+
+ Defined in:
+
+ manifests/nagios/resources/resource_df.pp
+
+
+
+
+
Summary
+ define manages the resources in/etc/nagios/private/resources.cfg
+
+
Overview
+
+
+
+
cd_nagios::nagios::resources::resource_df.pp
+Module name: cd_nagios
+Author:
+Arne Teuke (arne_teuke@ConfDroid.com)
+
+
License:
+
+
This file is part of cd_nagios.
+
+
cd_nagios is used for providing automatic configuration of Nagios
+
+Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com)
+ This program is
+free software: you can redistribute it and/or modify
+ it under the terms of
+the GNU General Public License as published by
+ the Free Software
+Foundation, either version 3 of the License, or
+ (at your option) any later
+version.
+
+
This program is distributed in the hope that it will be useful,
+ but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License
+for more details.
+
+
You should have received a copy of the GNU General Public License
+ along
+with this program. If not, see www.gnu.org/licenses /.
+
+
+
+
+
+
+
+
+
+
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+
+
+ # File 'manifests/nagios/resources/resource_df.pp', line 24
+
+define cd_nagios::nagios::resources::resource_df (
+
+$ng_user_arg_name = undef,
+$ng_user_arg_value = undef,
+$ng_user_arg_comment = undef,
+$ng_resource_rule_erb = '/cd_nagios/nagios/resource_cfg_rule.erb',
+
+) {
+
+$ng_nagios_server = $::cd_nagios::params::ng_nagios_server
+$ng_resource_file = $::cd_nagios::params::ng_resource_file
+
+
+ if $fqdn == $ng_nagios_server {
+
+ concat::fragment { "rule_${name}":
+ target => $ng_resource_file,
+ content => template($ng_resource_rule_erb),
+ order => '000',
+ }
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/UTF_Files b/tests/UTF_Files
index 402614d..3db19ff 100644
--- a/tests/UTF_Files
+++ b/tests/UTF_Files
@@ -5,4 +5,5 @@
./templates/httpd/index_html.erb: empty
./doc/css/style.css: HTML document, UTF-8 Unicode text, with very long lines
./doc/js/jquery.js: HTML document, UTF-8 Unicode text, with very long lines
+./doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aresources_3A_3Aresource.html: C++ source, UTF-8 Unicode text
./doc/puppet_classes/cd_nagios_3A_3Aparams.html: HTML document, UTF-8 Unicode text