# 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 . # @summary Class manages main timeperiods for NAGIOS through Puppet exports, # and populates /etc/nagios/conf.d/nagios_timeperiods_base.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, } @@nagios_timeperiod { 'office_hours': 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, } @@nagios_timeperiod { 'out_of_hours': 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, } @@nagios_timeperiod { 'none': 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, } } }