diff options
-rw-r--r-- | manifests/service.pp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/manifests/service.pp b/manifests/service.pp index ffbbc72..afc8650 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -10,7 +10,7 @@ define nagios::service ( $notification_period = '', $notification_options = '', $contact_groups = '', - $use = 'absent', + $use = 'generic-service', $service_description = 'absent' ) { @@ -22,7 +22,12 @@ define nagios::service ( ensure => $ensure, check_command => $check_command, host_name => $host_name, + use => $use, notify => Service[nagios], + service_description => $service_description ?{ + 'absent' => $name, + default => $service_description + } } if ($check_period != '') { @@ -56,18 +61,5 @@ define nagios::service ( if ($contact_groups != '') { Nagios_service["${real_name}"] { contact_groups => $contact_groups } } - - if ($use == 'absent') { - Nagios_service["${real_name}"] { use => 'generic-service' } - } else { - Nagios_service["${real_name}"] { use => $use } - } - - if ($service_description == 'absent') { - Nagios_service["${real_name}"] { service_description => $name } - } else { - Nagios_service["${real_name}"] { service_description => $service_description } - } - } |