added timeperiods
This commit is contained in:
@@ -25,7 +25,7 @@ class cd_nagios::nagios::objects::commands (
|
|||||||
|
|
||||||
) inherits cd_nagios::params {
|
) inherits cd_nagios::params {
|
||||||
|
|
||||||
require cd_nagios::main::install
|
if $::fqdn == $ng_nagios_server {
|
||||||
|
|
||||||
@@nagios_command { 'notify-host-by-email':
|
@@nagios_command { 'notify-host-by-email':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
@@ -248,3 +248,4 @@ class cd_nagios::nagios::objects::commands (
|
|||||||
target => $ng_target_command,
|
target => $ng_target_command,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class cd_nagios::nagios::objects::config (
|
|||||||
require cd_nagios::nagios::objects::add_hostgroup_rules
|
require cd_nagios::nagios::objects::add_hostgroup_rules
|
||||||
require cd_nagios::nagios::objects::servicegroups
|
require cd_nagios::nagios::objects::servicegroups
|
||||||
require cd_nagios::nagios::objects::add_servicegroup_rules
|
require cd_nagios::nagios::objects::add_servicegroup_rules
|
||||||
|
require cd_nagios::nagios::objects::timeperiods
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
48
manifests/nagios/objects/timeperiods.pp
Normal file
48
manifests/nagios/objects/timeperiods.pp
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# cd_nagios::nagios::objects::timeperiods.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 <http://www.gnu.org/licenses/>.
|
||||||
|
# @summary Class manages all timeperiods for NAGIOS through Puppet exports,
|
||||||
|
# and populates /etc/nagios/conf.d/nagios_timeperiods.cfg.
|
||||||
|
################################################################################
|
||||||
|
class cd_nagios::nagios::objects::timeperiods (
|
||||||
|
|
||||||
|
) inherits cd_nagios::params {
|
||||||
|
|
||||||
|
if $::fqdn == $ng_nagios_server {
|
||||||
|
|
||||||
|
@@nagios_timeperiod { '24x7':
|
||||||
|
ensure => present,
|
||||||
|
timeperiod_name => '24x7',
|
||||||
|
alias => '24 Hours A Day, 7 Days A Week',
|
||||||
|
monday => '00:00-24:00',
|
||||||
|
tuesday => '00:00-24:00',
|
||||||
|
wednesday => '00:00-24:00',
|
||||||
|
thursday => '00:00-24:00',
|
||||||
|
friday => '00:00-24:00',
|
||||||
|
saturday => '00:00-24:00',
|
||||||
|
sunday => '00:00-24:00',
|
||||||
|
owner => $ng_user,
|
||||||
|
group => $ng_user,
|
||||||
|
mode => '0640',
|
||||||
|
register => '1',
|
||||||
|
target => $ng_tgt_timeperiods_base,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -964,7 +964,7 @@ $ng_certbot_live = "${ng_certbot_main_dir}/live"
|
|||||||
$ng_target_templates = "${ng_conf_d_dir}/nagios_templates.cfg"
|
$ng_target_templates = "${ng_conf_d_dir}/nagios_templates.cfg"
|
||||||
$ng_templates_head_erb = 'cd_nagios/nagios/templates_cfg_head.erb'
|
$ng_templates_head_erb = 'cd_nagios/nagios/templates_cfg_head.erb'
|
||||||
$ng_templates_rule_erb = 'cd_nagios/nagios/templates_cfg_rule.erb'
|
$ng_templates_rule_erb = 'cd_nagios/nagios/templates_cfg_rule.erb'
|
||||||
$ng_target_timeperiods = "${ng_conf_d_dir}/timeperiods.cfg"
|
$ng_tgt_timeperiods_base = "${ng_conf_d_dir}/timeperiods.cfg"
|
||||||
$ng_target_localhost = "${ng_conf_d_dir}/nagios_localhost.cfg"
|
$ng_target_localhost = "${ng_conf_d_dir}/nagios_localhost.cfg"
|
||||||
$ng_target_host = "${ng_conf_d_dir}/nagios_host.cfg"
|
$ng_target_host = "${ng_conf_d_dir}/nagios_host.cfg"
|
||||||
$ng_target_hostgroup_base = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg"
|
$ng_target_hostgroup_base = "${ng_conf_d_dir}/nagios_hostgroups_base.cfg"
|
||||||
|
|||||||
Reference in New Issue
Block a user