diff --git a/manifests/nagios/objects/config.pp b/manifests/nagios/objects/config.pp index e202543..0edadd2 100644 --- a/manifests/nagios/objects/config.pp +++ b/manifests/nagios/objects/config.pp @@ -30,6 +30,7 @@ class cd_nagios::nagios::objects::config ( require cd_nagios::nagios::objects::template_rules require cd_nagios::nagios::objects::contacts require cd_nagios::nagios::objects::add_contact_rules + require cd_nagios::nagios::objects::contactgroups } } diff --git a/manifests/nagios/objects/contactgroups.pp b/manifests/nagios/objects/contactgroups.pp new file mode 100644 index 0000000..0697db5 --- /dev/null +++ b/manifests/nagios/objects/contactgroups.pp @@ -0,0 +1,61 @@ +## cd_nagios::nagios::objects::contactgroups.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 +################################################################################ +class cd_nagios::nagios::objects::contactgroups ( + + +) inherits cd_nagios::params { + if $::fqdn == $ng_nagios_server { + + @@nagios_contactgroup { 'admins': + ensure => present, + alias => 'Nagios Administrators', + contactgroup_name => 'admins', + owner => $ng_user, + group => $ng_user, + mode => '0640', + register => '1', + target => $ng_tgt_contactgroup_base, + } + + @@nagios_contactgroup { 'operations': + ensure => present, + alias => 'Operations Team', + contactgroup_name => 'operations', + owner => $ng_user, + group => $ng_user, + mode => '0640', + register => '1', + target => $ng_tgt_contactgroup_base, + } + + @@nagios_contactgroup { 'support': + ensure => present, + alias => 'Support Team', + contactgroup_name => 'support', + owner => $ng_user, + group => $ng_user, + mode => '0640', + register => '1', + target => $ng_tgt_contactgroup_base, + } + } +} diff --git a/manifests/params.pp b/manifests/params.pp index 15c3730..37d50c5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -975,7 +975,7 @@ $ng_target_base_contact = "${ng_conf_d_dir}/nagios_base_contact.cfg" $ng_target_add_contact = "${ng_conf_d_dir}/nagios_add_contact.cfg" $ng_contacts_head_erb = 'cd_nagios/nagios/contacts_cfg_head.erb' $ng_contacts_rule_erb = 'cd_nagios/nagios/contacts_cfg_rule.erb' -$ng_target_contactgroup = "${ng_conf_d_dir}/nagios_contactgroup.cfg" +$ng_tgt_contactgroup_base = "${ng_conf_d_dir}/nagios_contactgroup_base.cfg" $ng_target_command = "${ng_conf_d_dir}/nagios_command.cfg"