2017-07-27 14:42:38 +01:00
|
|
|
# cd_nagios::nagios::objects::timeperiods.pp
|
|
|
|
|
# Module name: cd_nagios
|
|
|
|
|
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
2017-07-27 15:28:21 +01:00
|
|
|
# @summary Class manages main timeperiods for NAGIOS through Puppet exports,
|
|
|
|
|
# and populates /etc/nagios/conf.d/nagios_timeperiods_base.cfg.
|
2017-07-27 14:42:38 +01:00
|
|
|
################################################################################
|
|
|
|
|
class cd_nagios::nagios::objects::timeperiods (
|
|
|
|
|
|
|
|
|
|
) inherits cd_nagios::params {
|
|
|
|
|
if $::fqdn == $ng_nagios_server {
|
|
|
|
|
@@nagios_timeperiod { '24x7':
|
2025-05-12 15:56:17 +02:00
|
|
|
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,
|
2017-07-27 14:42:38 +01:00
|
|
|
}
|
2017-07-27 14:46:49 +01:00
|
|
|
|
|
|
|
|
@@nagios_timeperiod { 'office_hours':
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => present,
|
|
|
|
|
timeperiod_name => 'office_hours',
|
|
|
|
|
alias => 'Office hours only, 5 Days A Week 09-05',
|
|
|
|
|
monday => '09:00-17:00',
|
|
|
|
|
tuesday => '09:00-17:00',
|
|
|
|
|
wednesday => '09:00-17:00',
|
|
|
|
|
thursday => '09:00-17:00',
|
|
|
|
|
friday => '09:00-17:00',
|
|
|
|
|
saturday => '00:00-00:00',
|
|
|
|
|
sunday => '00:00-00:00',
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
|
|
|
|
register => '1',
|
|
|
|
|
target => $ng_tgt_timeperiods_base,
|
2017-07-27 14:50:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@nagios_timeperiod { 'out_of_hours':
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => present,
|
|
|
|
|
timeperiod_name => 'out_of_hours',
|
|
|
|
|
alias => 'Outside Office hours only',
|
|
|
|
|
monday => '17:00-09:00',
|
|
|
|
|
tuesday => '17:00-09:00',
|
|
|
|
|
wednesday => '17:00-09:00',
|
|
|
|
|
thursday => '17:00-09:00',
|
|
|
|
|
friday => '17:00-09: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,
|
2017-07-27 14:46:49 +01:00
|
|
|
}
|
2017-07-27 15:28:21 +01:00
|
|
|
|
|
|
|
|
@@nagios_timeperiod { 'none':
|
2025-05-12 15:56:17 +02:00
|
|
|
ensure => present,
|
|
|
|
|
timeperiod_name => 'none',
|
|
|
|
|
alias => 'No Time Is A Good Time',
|
|
|
|
|
owner => $ng_user,
|
|
|
|
|
group => $ng_user,
|
|
|
|
|
mode => '0640',
|
|
|
|
|
register => '1',
|
|
|
|
|
target => $ng_tgt_timeperiods_base,
|
2017-07-27 15:28:21 +01:00
|
|
|
}
|
2017-07-27 14:42:38 +01:00
|
|
|
}
|
|
|
|
|
}
|