summaryrefslogtreecommitdiff
path: root/manifests/service.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/service.pp')
-rw-r--r--manifests/service.pp20
1 files changed, 11 insertions, 9 deletions
diff --git a/manifests/service.pp b/manifests/service.pp
index 134d1f7..c214d7e 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -12,7 +12,7 @@ define nagios::service (
$contact_groups = '',
$use = 'generic-service',
$service_description = 'absent',
- $use_nrpe = '',
+ $use_nrpe = false,
$nrpe_args = '',
$nrpe_timeout = 10
) {
@@ -30,20 +30,22 @@ define nagios::service (
if $check_comand == 'absent' {
fail("Must pass a check_command to ${name} if it should be present")
}
- if ($use_nrpe == 'true') {
- include nagios::command::nrpe_timeout
+ if $use_nrpe == true {
+ include nagios::command::nrpe_timeout
if ($nrpe_args != '') {
- $real_check_command = "check_nrpe_timeout!$nrpe_timeout!$check_command!\"$nrpe_args\""
- } else {
- $real_check_command = "check_nrpe_1arg_timeout!$nrpe_timeout!$check_command"
- }
- } else {
+ $real_check_command = "check_nrpe_timeout!$nrpe_timeout!$check_command!\"$nrpe_args\""
+ }
+ else {
+ $real_check_command = "check_nrpe_1arg_timeout!$nrpe_timeout!$check_command"
+ }
+ }
+ else {
$real_check_command = "$check_command"
}
Nagios_service["${real_name}"] {
- check_command => $check_command,
+ check_command => $real_check_command,
host_name => $host_name,
use => $use,
service_description => $service_description ?{