2017-07-26 12:16:25 +01:00
|
|
|
## cd_nagios::nagios::objects::add_contact.pp
|
|
|
|
|
# Module name: cd_nagios
|
|
|
|
|
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
|
|
|
|
# @summary Define manages additional contacts known to NAGIOS through external
|
|
|
|
|
# Puppet rules, and populates /etc/nagios/conf.d/nagios_add_contact.cfg.
|
|
|
|
|
# @example
|
2017-07-27 13:32:48 +01:00
|
|
|
# cd_nagios::nagios::objects::add_contact { 'example_user':
|
|
|
|
|
# ng_contact_name => 'example_user',
|
|
|
|
|
# ng_contact_alias => 'Example User',
|
|
|
|
|
# ng_contact_groups => 'admins',
|
|
|
|
|
# ng_contact_email => 'example@example.net',
|
|
|
|
|
# }
|
2017-07-27 14:33:00 +01:00
|
|
|
# @param [string] ng_contact_name Specify the contact short name.
|
2025-05-12 15:56:17 +02:00
|
|
|
# @param [string] ng_contact_use which contact template to use
|
|
|
|
|
# @param [string] ng_contact_alias Specify the contact alias (long name).
|
|
|
|
|
# @param [string] ng_contact_email Specify the contact email address.
|
|
|
|
|
# @param [string] ng_contact_groups specify the contact group for the contact.
|
2017-07-26 12:16:25 +01:00
|
|
|
################################################################################
|
|
|
|
|
define cd_nagios::nagios::objects::add_contact (
|
|
|
|
|
|
2025-05-12 15:56:17 +02:00
|
|
|
Optional[String] $ng_contact_name = undef,
|
|
|
|
|
String $ng_contact_use = 'generic-contact',
|
|
|
|
|
Optional[String] $ng_contact_alias = undef,
|
|
|
|
|
Optional[String] $ng_contact_email = undef,
|
|
|
|
|
Optional[String] $ng_contact_groups = undef,
|
2017-07-26 12:16:25 +01:00
|
|
|
|
|
|
|
|
) {
|
2025-05-12 15:56:17 +02:00
|
|
|
$ng_nagios_server = $::cd_nagios::params::ng_nagios_server
|
|
|
|
|
$ng_target_add_contact = $::cd_nagios::params::ng_target_add_contact
|
|
|
|
|
$ng_contacts_rule_erb = $::cd_nagios::params::ng_contacts_rule_erb
|
2017-07-26 13:34:50 +01:00
|
|
|
|
|
|
|
|
if $::fqdn == $ng_nagios_server {
|
|
|
|
|
concat::fragment { $name:
|
2025-05-12 15:56:17 +02:00
|
|
|
target => $ng_target_add_contact,
|
|
|
|
|
content => template($ng_contacts_rule_erb),
|
2017-07-26 13:34:50 +01:00
|
|
|
}
|
|
|
|
|
}
|
2017-07-26 12:16:25 +01:00
|
|
|
}
|