added contact stanza

This commit is contained in:
Arne Teuke
2017-07-25 16:57:10 +01:00
parent 8a97768e4b
commit 6a57847a12
3 changed files with 21 additions and 8 deletions

View File

@@ -39,15 +39,15 @@ class cd_nagios::nagios::objects::template_rules (
mode => '0640',
selrange => s0,
selrole => object_r,
aeltype => nagios_etc_t,
seltype => nagios_etc_t,
seluser => system_u,
content => template[$ng_templates_head_erb],
notify => Service[$ng_service],
notify => Service[$ng_service],
}
# example rule
cd_nagios::objects::templates { $name:
ng_template_object => 'service',
ng_template_object => 'contact',
}
}
}

View File

@@ -22,8 +22,15 @@
################################################################################
define cd_nagios::nagios::objects::templates (
$ng_template_object = undef,
$ng_template_object = undef,
$ng_template_object_name = undef,
$ng_svc_notification_period = '24x7',
$ng_host_notification_period = '24x7',
$ng_service_notification_options = 'w,u,c,r,f,s',
$ng_host_notification_options = 'd,u,r,f,s',
$ng_service_notification_commands = 'notify-service-by-email',
$ng_host_notification_commands = 'notify-host-by-email',
$ng_object_register = '0',
) {

View File

@@ -1,9 +1,15 @@
<% if @ng_template_object == 'contact' -%>
define <%= @ng_template_object %>{
name <%= @ng_template_object_name %>;
}
name <%= @ng_template_object_name %> ;
service_notification_period <%= @ng_svc_notification_period %> ;
host_notification_period <%= @ng_host_notification_period %> ;
service_notification_options <%= @ng_service_notification_options %> ;
host_notification_options <%= @ng_host_notification_options %> ;
service_notification_commands <%= @ng_service_notification_commands %> ;
host_notification_commands <%= @ng_host_notification_commands %> ;
register <%= @ng_object_register %> ;
}
<% elsif @ng_template_object == 'host' -%>
<% elsif @ng_template_object == 'service' -%>