Files
confdroid_nagios/manifests/nagios/objects/add_timeperiods.pp

52 lines
2.3 KiB
ObjectPascal
Raw Normal View History

2017-07-27 15:28:21 +01:00
## cd_nagios::nagios::objects::add_timeperiods.pp
# Module name: cd_nagios
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
# @summary define populates /etc/nagios/conf.d/nagios_timeperiods_add through
# extermal Puppet rules.
# @example
# cd_nagios::nagios::objects::add_timeperiods { 'example_timeperiod':
2017-07-27 15:40:02 +01:00
# ng_timeperiod_name => 'example_timeperiod',
# ng_timeperiod_alias => 'Example timeperiod',
# ng_timep_monday => '00:00-00:00',
# ng_timep_tuesday => '00:00-00:00',
# ng_timep_wednesday => '00:00-00:00',
# ng_timep_thursday => '00:00-00:00',
# ng_timep_friday => '00:00-00:00',
# ng_timep_saturday => '00:00-00:00',
# ng_timep_sunday => '00:00-00:00',
2017-07-27 15:28:21 +01:00
# }
2025-05-12 15:56:17 +02:00
# @param [string] ng_timep_name Specify the timeperiod short name.
# @param [string] ng_timep_alias Specify the timeperiod alias (long name)
# @param [string] ng_timep_monday Specify the desired hours for Monday
# @param [string] ng_timep_tuesday Specify the desired hours for Tuesday
# @param [string] ng_timep_wednesday Specify the desired hours for Wednesday.
# @param [string] ng_timep_thursday Specify the desired hours for Thursday
# @param [string] ng_timep_friday Specify the desired hours for Friday
# @param [string] ng_timep_saturday Specify the desired hours for Saturday
# @param [string] ng_timep_sunday Specify the desired hours for Sunday.
2017-07-27 15:28:21 +01:00
###############################################################################
define cd_nagios::nagios::objects::add_timeperiods (
2025-05-12 15:56:17 +02:00
Optional[String] $ng_timep_name = undef,
Optional[String] $ng_timep_alias = undef,
String $ng_timep_monday = '00:00-00:00',
String $ng_timep_tuesday = '00:00-00:00',
String $ng_timep_wednesday = '00:00-00:00',
String $ng_timep_thursday = '00:00-00:00',
String $ng_timep_friday = '00:00-00:00',
String $ng_timep_saturday = '00:00-00:00',
String $ng_timep_sunday = '00:00-00:00',
2017-07-27 15:28:21 +01:00
) {
2025-05-12 15:56:17 +02:00
$ng_nagios_server = $cd_nagios::params::ng_nagios_server
$ng_tgt_timep_add = $cd_nagios::params::ng_tgt_timep_add
$ng_tgt_timep_rule_erb = $cd_nagios::params::ng_tgt_timep_rule_erb
2017-07-27 15:28:21 +01:00
if $::fqdn == $ng_nagios_server {
concat::fragment { $name:
2025-05-12 15:56:17 +02:00
target => $ng_tgt_timep_add,
content => template($ng_tgt_timep_rule_erb),
2017-07-27 15:28:21 +01:00
}
}
}