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

31 lines
1.2 KiB
ObjectPascal
Raw Normal View History

2017-07-27 11:05:58 +01:00
## cd_nagios::nagios::objects::add_contactgroups.pp
# Module name: cd_nagios
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
# @summary Define populates /etc/nagios/conf.d/nagios_add_contactgroups through
# external puppet rules.
2017-07-27 12:58:30 +01:00
# @param [string] ng_contactgroup_name Specify the short name of the
# contact group.
2025-05-12 15:56:17 +02:00
# @param [string] ng_contactgroup_alias Specify the alias (long name) of the
2017-07-27 12:58:30 +01:00
# contact group
2025-05-12 15:56:17 +02:00
# @param [string] ng_contactgroup_register Specify whether the contact group
2017-07-27 12:58:30 +01:00
# should be registered in Nagios.
2017-07-27 11:05:58 +01:00
################################################################################
define cd_nagios::nagios::objects::add_contactgroups (
2025-05-12 15:56:17 +02:00
Optional[String] $ng_contactgroup_name = undef,
Optional[String] $ng_contactgroup_alias = undef,
String $ng_contactgroup_register = '1',
2017-07-27 11:05:58 +01:00
) {
2025-05-12 15:56:17 +02:00
$ng_nagios_server = $cd_nagios::params::ng_nagios_server
$ng_tgt_contactgroup_add = $cd_nagios::params::ng_tgt_contactgroup_add
$ng_cntctgrps_rule_erb = $cd_nagios::params::ng_cntctgrps_rule_erb
2017-07-27 11:05:58 +01:00
if $::fqdn == $ng_nagios_server {
concat::fragment { $name:
2025-05-12 15:56:17 +02:00
target => $ng_tgt_contactgroup_add,
content => template($ng_cntctgrps_rule_erb),
}
2017-07-27 11:05:58 +01:00
}
}