OP#436 add nagios contacts
This commit is contained in:
38
manifests/nagios/objects/add_contact.pp
Normal file
38
manifests/nagios/objects/add_contact.pp
Normal file
@@ -0,0 +1,38 @@
|
||||
## confdroid_nagios::nagios::objects::add_contact.pp
|
||||
# Module name: confdroid_nagios
|
||||
# Author: 12ww1160 (12ww1160@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
|
||||
# confdroid_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',
|
||||
# }
|
||||
# @param [string] ng_contact_name Specify the contact short name.
|
||||
# @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.
|
||||
################################################################################
|
||||
define confdroid_nagios::nagios::objects::add_contact (
|
||||
|
||||
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,
|
||||
|
||||
) {
|
||||
$ng_nagios_server = $confdroid_nagios::params::ng_nagios_server
|
||||
$ng_target_add_contact = $confdroid_nagios::params::ng_target_add_contact
|
||||
$ng_contacts_rule_erb = $confdroid_nagios::params::ng_contacts_rule_erb
|
||||
|
||||
if $ng_nagios_server == $fqdn {
|
||||
concat::fragment { $name:
|
||||
target => $ng_target_add_contact,
|
||||
content => template($ng_contacts_rule_erb),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user