diff --git a/CHANGELOG.md b/CHANGELOG.md
index c916937..456a3c5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,16 @@ Changelog of Git Changelog.
diff --git a/doc/puppet_classes/cd_nagios.html b/doc/puppet_classes/cd_nagios.html
index bd50208..d67d06e 100644
--- a/doc/puppet_classes/cd_nagios.html
+++ b/doc/puppet_classes/cd_nagios.html
@@ -139,7 +139,7 @@ class cd_nagios {
diff --git a/doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html b/doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html
index 836150f..1ecdd98 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Acertbot_3A_3Acerts.html
@@ -230,7 +230,7 @@ class cd_nagios::certbot::certs (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html b/doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html
index c1e54bd..4b84b20 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html
@@ -368,7 +368,7 @@ class cd_nagios::client::target (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html b/doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html
index c924708..2530e69 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html
@@ -207,7 +207,7 @@ class cd_nagios::firewall::iptables (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html
index 742c9ec..a0d0cf6 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html
@@ -195,7 +195,7 @@ class cd_nagios::main::config (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html
index ff4189d..8c85714 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html
@@ -468,7 +468,7 @@ class cd_nagios::main::dirs (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html
index 27c9e4d..132e95a 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html
@@ -235,7 +235,7 @@ class cd_nagios::main::install (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html
index d412ab1..14461e8 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html
@@ -200,7 +200,7 @@ class cd_nagios::main::user (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html
index 004f773..5113d85 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact_rules.html
@@ -210,7 +210,7 @@ class cd_nagios::nagios::objects::add_contact_rules (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html
index 0d5d14d..3e91e6e 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups_rules.html
@@ -227,7 +227,7 @@ class cd_nagios::nagios::objects::add_contactgroups_rules (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html
index c8d54f5..5d4425a 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acommands.html
@@ -595,7 +595,7 @@ class cd_nagios::nagios::objects::commands (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html
index 95bc29f..e6124d7 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aconfig.html
@@ -143,7 +143,8 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses/.
34
35
36
-37
+37
+38
# File 'manifests/nagios/objects/config.pp', line 23
@@ -160,6 +161,7 @@ class cd_nagios::nagios::objects::config (
require cd_nagios::nagios::objects::add_contact_rules
require cd_nagios::nagios::objects::contactgroups
require cd_nagios::nagios::objects::add_contactgroups_rules
+ require cd_nagios::nagios::objects::hostgroups
}
}
@@ -170,7 +172,7 @@ class cd_nagios::nagios::objects::config (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html
index 70f2fef..36c1696 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontactgroups.html
@@ -237,7 +237,7 @@ class cd_nagios::nagios::objects::contactgroups (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html
index 882cd17..f53524e 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Acontacts.html
@@ -280,7 +280,7 @@ class cd_nagios::nagios::objects::contacts (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Ahostgroups.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Ahostgroups.html
new file mode 100644
index 0000000..a1ac9c2
--- /dev/null
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Ahostgroups.html
@@ -0,0 +1,561 @@
+
+
+
+
+
+
+ Puppet Class: cd_nagios::nagios::objects::hostgroups
+
+ — Documentation by YARD 0.9.9
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Puppet Class: cd_nagios::nagios::objects::hostgroups
+
+
+
+ Inherits:
+ cd_nagios::params
+
+
+
+
+ Defined in:
+
+ manifests/nagios/objects/hostgroups.pp
+
+
+
+
+
Summary
+ Class manages basic hostgroups known to NAGIOS through Puppet
+exports, and populates /etc/nagios/conf.d/nagios_base_hostgroups.cfg.
+
+
Overview
+
+
+
+
cd_nagios::nagios::objects::hostgroups.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
+46
+47
+48
+49
+50
+51
+52
+53
+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
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+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
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+
+
+ # File 'manifests/nagios/objects/hostgroups.pp', line 24
+
+class cd_nagios::nagios::objects::hostgroups (
+
+
+) inherits cd_nagios::params {
+
+ if $::fqdn == $ng_nagios_server {
+
+ # linux servers
+
+ @@nagios_hostgroup { 'linux-servers':
+ ensure => present,
+ hostgroup_name => 'linux-servers',
+ alias => 'Linux Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+
+ # RHEL servers
+
+ @@nagios_hostgroup { 'rhel-servers':
+ ensure => present,
+ hostgroup_name => 'rhel-servers',
+ alias => 'RHEL Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # CentOS servers
+
+ @@nagios_hostgroup { 'centos-servers':
+ ensure => present,
+ hostgroup_name => 'centos-servers',
+ alias => 'CentOS Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # SuSE servers
+
+ @@nagios_hostgroup { 'suse-servers':
+ ensure => present,
+ hostgroup_name => 'suse-servers',
+ alias => 'SuSE Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Unix servers
+
+ @@nagios_hostgroup { 'unix-servers':
+ ensure => present,
+ hostgroup_name => 'unix-servers',
+ alias => 'Unix Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Solaris servers
+
+ @@nagios_hostgroup { 'solaris-servers':
+ ensure => present,
+ hostgroup_name => 'solaris-servers',
+ alias => 'Solaris Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # AIX servers
+
+ @@nagios_hostgroup { 'aix-servers':
+ ensure => present,
+ hostgroup_name => 'aix-servers',
+ alias => 'AIX Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Windows servers
+
+ @@nagios_hostgroup { 'windows-servers':
+ ensure => present,
+ hostgroup_name => 'windows-servers',
+ alias => 'Windows Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Netware servers
+
+ @@nagios_hostgroup { 'netware-servers':
+ ensure => present,
+ hostgroup_name => 'netware-servers',
+ alias => 'Netware Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # DB servers
+
+ @@nagios_hostgroup { 'db-servers':
+ ensure => present,
+ hostgroup_name => 'db-servers',
+ alias => 'DB Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Oracle servers
+
+ @@nagios_hostgroup { 'oracle-servers':
+ ensure => present,
+ hostgroup_name => 'oracle-servers',
+ alias => 'Oracle Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # MySQL servers
+
+ @@nagios_hostgroup { 'mysql-servers':
+ ensure => present,
+ hostgroup_name => 'mysql-servers',
+ alias => 'MySQL Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # MSSQL servers
+
+ @@nagios_hostgroup { 'mssql-servers':
+ ensure => present,
+ hostgroup_name => 'mssql-servers',
+ alias => 'MSSQL Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # NOSQL servers
+
+ @@nagios_hostgroup { 'nosql-servers':
+ ensure => present,
+ hostgroup_name => 'nosql-servers',
+ alias => 'NOSQL Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Hadoop servers
+
+ @@nagios_hostgroup { 'hadoop-servers':
+ ensure => present,
+ hostgroup_name => 'hadoop-servers',
+ alias => 'HADOOP Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html
index b96a20b..852bf5b 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplate_rules.html
@@ -305,7 +305,7 @@ class cd_nagios::nagios::objects::template_rules (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Aparams.html b/doc/puppet_classes/cd_nagios_3A_3Aparams.html
index 2ec1e07..182dc85 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aparams.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aparams.html
@@ -95,6 +95,8 @@
cd_nagios::nagios::objects::contacts
+ cd_nagios::nagios::objects::hostgroups
+
cd_nagios::nagios::objects::contactgroups
cd_nagios::nagios::objects::template_rules
@@ -5550,7 +5552,7 @@ $ng_templates_rule_erb = 'cd_nagios/nagios/templates_cfg_rule.erb'
$ng_target_timeperiods = "${ng_conf_d_dir}/timeperiods.cfg"
$ng_target_localhost = "${ng_conf_d_dir}/nagios_localhost.cfg"
$ng_target_host = "${ng_conf_d_dir}/nagios_host.cfg"
-$ng_target_hostgroup = "${ng_conf_d_dir}/nagios_hostgroup.cfg"
+$ng_target_hostgroup = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg"
$ng_target_hostdep = "${ng_conf_d_dir}/nagios_hostdependency.cfg"
$ng_target_hostesc = "${ng_conf_d_dir}/nagios_hostescalation.cfg"
$ng_target_hostext = "${ng_conf_d_dir}/nagios_hostextinfo.cfg"
@@ -5564,7 +5566,7 @@ $ng_tgt_contactgroup_base = "${ng_conf_d_dir}/nagios_contactgroup_base.cfg&
$ng_tgt_contactgroup_add = "${ng_conf_d_dir}/nagios_contactgroup_add.cfg"
$ng_cntctgrps_head_erb = 'cd_nagios/nagios/contactgroups_cfg_head.erb'
$ng_cntctgrps_rule_erb = 'cd_nagios/nagios/contactgroups_cfg_rule.erb'
-$ng_target_command = "${ng_conf_d_dir}/nagios_command.cfg"
+$ng_target_command = "${ng_conf_d_dir}/nagios_commands_base.cfg"
# includes must be last
@@ -5579,7 +5581,7 @@ $ng_target_command = "${ng_conf_d_dir}/nagios_command.cfg"
diff --git a/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html b/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html
index 6bac11f..09fbef3 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html
@@ -249,7 +249,7 @@ class cd_nagios::selinux::config (
diff --git a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html
index fc432c3..2166aaf 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html
@@ -195,7 +195,7 @@ class cd_nagios::server::access_rules (
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 571c702..468ffe9 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html
@@ -334,7 +334,7 @@ class cd_nagios::server::files (
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 1cc0754..29a6b82 100644
--- a/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
+++ b/doc/puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html
@@ -268,7 +268,7 @@ class cd_nagios::server::service (
diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html
index 3eea3bd..d4ce872 100644
--- a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html
+++ b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contact.html
@@ -247,7 +247,7 @@ $ng_contacts_rule_erb = $::cd_nagios::params::ng_contacts_rule_erb
diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html
index ed979ae..6078a2b 100644
--- a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html
+++ b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Aadd_contactgroups.html
@@ -219,7 +219,7 @@ $ng_cntctgrps_rule_erb = $::cd_nagios::params::ng_cntctgrps_rule_erb
diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html
index 77b26ae..978daa0 100644
--- a/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html
+++ b/doc/puppet_defined_types/cd_nagios_3A_3Anagios_3A_3Aobjects_3A_3Atemplates.html
@@ -935,7 +935,7 @@ $ng_templates_rule_erb = $::cd_nagios::params::ng_templates_rule_erb
diff --git a/doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html b/doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html
index b0471d2..b8addc6 100644
--- a/doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html
+++ b/doc/puppet_defined_types/cd_nagios_3A_3Aserver_3A_3Aaccess.html
@@ -220,7 +220,7 @@ $ng_service = $::cd_nagios::params::ng_service
diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html
index 6369957..3a4383c 100644
--- a/doc/top-level-namespace.html
+++ b/doc/top-level-namespace.html
@@ -90,7 +90,7 @@
diff --git a/manifests/nagios/objects/config.pp b/manifests/nagios/objects/config.pp
index e9a0922..82bf493 100644
--- a/manifests/nagios/objects/config.pp
+++ b/manifests/nagios/objects/config.pp
@@ -32,6 +32,7 @@ class cd_nagios::nagios::objects::config (
require cd_nagios::nagios::objects::add_contact_rules
require cd_nagios::nagios::objects::contactgroups
require cd_nagios::nagios::objects::add_contactgroups_rules
+ require cd_nagios::nagios::objects::hostgroups
}
}
diff --git a/manifests/nagios/objects/hostgroups.pp b/manifests/nagios/objects/hostgroups.pp
new file mode 100644
index 0000000..4c99d31
--- /dev/null
+++ b/manifests/nagios/objects/hostgroups.pp
@@ -0,0 +1,228 @@
+## cd_nagios::nagios::objects::hostgroups.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 .
+# @summary Class manages basic hostgroups known to NAGIOS through Puppet
+# exports, and populates /etc/nagios/conf.d/nagios_base_hostgroups.cfg.
+################################################################################
+class cd_nagios::nagios::objects::hostgroups (
+
+
+) inherits cd_nagios::params {
+
+ if $::fqdn == $ng_nagios_server {
+
+ # linux servers
+
+ @@nagios_hostgroup { 'linux-servers':
+ ensure => present,
+ hostgroup_name => 'linux-servers',
+ alias => 'Linux Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+
+ # RHEL servers
+
+ @@nagios_hostgroup { 'rhel-servers':
+ ensure => present,
+ hostgroup_name => 'rhel-servers',
+ alias => 'RHEL Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # CentOS servers
+
+ @@nagios_hostgroup { 'centos-servers':
+ ensure => present,
+ hostgroup_name => 'centos-servers',
+ alias => 'CentOS Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # SuSE servers
+
+ @@nagios_hostgroup { 'suse-servers':
+ ensure => present,
+ hostgroup_name => 'suse-servers',
+ alias => 'SuSE Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Unix servers
+
+ @@nagios_hostgroup { 'unix-servers':
+ ensure => present,
+ hostgroup_name => 'unix-servers',
+ alias => 'Unix Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Solaris servers
+
+ @@nagios_hostgroup { 'solaris-servers':
+ ensure => present,
+ hostgroup_name => 'solaris-servers',
+ alias => 'Solaris Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # AIX servers
+
+ @@nagios_hostgroup { 'aix-servers':
+ ensure => present,
+ hostgroup_name => 'aix-servers',
+ alias => 'AIX Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Windows servers
+
+ @@nagios_hostgroup { 'windows-servers':
+ ensure => present,
+ hostgroup_name => 'windows-servers',
+ alias => 'Windows Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Netware servers
+
+ @@nagios_hostgroup { 'netware-servers':
+ ensure => present,
+ hostgroup_name => 'netware-servers',
+ alias => 'Netware Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # DB servers
+
+ @@nagios_hostgroup { 'db-servers':
+ ensure => present,
+ hostgroup_name => 'db-servers',
+ alias => 'DB Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Oracle servers
+
+ @@nagios_hostgroup { 'oracle-servers':
+ ensure => present,
+ hostgroup_name => 'oracle-servers',
+ alias => 'Oracle Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # MySQL servers
+
+ @@nagios_hostgroup { 'mysql-servers':
+ ensure => present,
+ hostgroup_name => 'mysql-servers',
+ alias => 'MySQL Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # MSSQL servers
+
+ @@nagios_hostgroup { 'mssql-servers':
+ ensure => present,
+ hostgroup_name => 'mssql-servers',
+ alias => 'MSSQL Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # NOSQL servers
+
+ @@nagios_hostgroup { 'nosql-servers':
+ ensure => present,
+ hostgroup_name => 'nosql-servers',
+ alias => 'NOSQL Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ # Hadoop servers
+
+ @@nagios_hostgroup { 'hadoop-servers':
+ ensure => present,
+ hostgroup_name => 'hadoop-servers',
+ alias => 'HADOOP Servers',
+ owner => $ng_user,
+ group => $ng_user,
+ mode => '0640',
+ register => '1',
+ target => $ng_target_hostgroup,
+ }
+
+ }
+}
diff --git a/manifests/params.pp b/manifests/params.pp
index 1589b8a..c0396fd 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -965,7 +965,7 @@ $ng_templates_rule_erb = 'cd_nagios/nagios/templates_cfg_rule.erb'
$ng_target_timeperiods = "${ng_conf_d_dir}/timeperiods.cfg"
$ng_target_localhost = "${ng_conf_d_dir}/nagios_localhost.cfg"
$ng_target_host = "${ng_conf_d_dir}/nagios_host.cfg"
-$ng_target_hostgroup = "${ng_conf_d_dir}/nagios_hostgroup.cfg"
+$ng_target_hostgroup = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg"
$ng_target_hostdep = "${ng_conf_d_dir}/nagios_hostdependency.cfg"
$ng_target_hostesc = "${ng_conf_d_dir}/nagios_hostescalation.cfg"
$ng_target_hostext = "${ng_conf_d_dir}/nagios_hostextinfo.cfg"
@@ -979,7 +979,7 @@ $ng_tgt_contactgroup_base = "${ng_conf_d_dir}/nagios_contactgroup_base.cfg"
$ng_tgt_contactgroup_add = "${ng_conf_d_dir}/nagios_contactgroup_add.cfg"
$ng_cntctgrps_head_erb = 'cd_nagios/nagios/contactgroups_cfg_head.erb'
$ng_cntctgrps_rule_erb = 'cd_nagios/nagios/contactgroups_cfg_rule.erb'
-$ng_target_command = "${ng_conf_d_dir}/nagios_command.cfg"
+$ng_target_command = "${ng_conf_d_dir}/nagios_commands_base.cfg"
# includes must be last
diff --git a/templates/nagios/contactgroups_cfg_rule.erb b/templates/nagios/contactgroups_cfg_rule.erb
index f4bbd98..a3c7d4c 100644
--- a/templates/nagios/contactgroups_cfg_rule.erb
+++ b/templates/nagios/contactgroups_cfg_rule.erb
@@ -1,3 +1,4 @@
+
define contactgroup {
contactgroup_name <%= @ng_contactgroup_name %>
alias <%= @ng_contactgroup_alias %>
diff --git a/templates/nagios/contacts_cfg_rule.erb b/templates/nagios/contacts_cfg_rule.erb
index 6f103fa..356fa67 100644
--- a/templates/nagios/contacts_cfg_rule.erb
+++ b/templates/nagios/contacts_cfg_rule.erb
@@ -1,3 +1,4 @@
+
define contact {
contact_name <%= @ng_contact_name %>
use <%= @ng_contact_use %>