diff --git a/manifests/nagios/objects/template_rules.pp b/manifests/nagios/objects/template_rules.pp index 19da83a..f802b18 100644 --- a/manifests/nagios/objects/template_rules.pp +++ b/manifests/nagios/objects/template_rules.pp @@ -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', } } } diff --git a/manifests/nagios/objects/templates.pp b/manifests/nagios/objects/templates.pp index d2fc6f8..7c05639 100644 --- a/manifests/nagios/objects/templates.pp +++ b/manifests/nagios/objects/templates.pp @@ -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', ) { diff --git a/templates/nagios/templates_cfg_rule.erb b/templates/nagios/templates_cfg_rule.erb index ece05d5..b5a213d 100644 --- a/templates/nagios/templates_cfg_rule.erb +++ b/templates/nagios/templates_cfg_rule.erb @@ -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' -%>