diff options
Diffstat (limited to 'manifests/service.pp')
-rw-r--r-- | manifests/service.pp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/manifests/service.pp b/manifests/service.pp index a739317..71f78b0 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -11,16 +11,33 @@ define nagios::service ( $notification_options = '', $contact_groups = '', $use = 'generic-service', - $service_description = 'absent' ) + $service_description = 'absent', + $use_nrpe = '', + $nrpe_args = '', + $nrpe_timeout = 10 ) { # TODO: this resource should normally accept all nagios_host parameters $real_name = "${::hostname}_${name}" + 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_command" + } + @@nagios_service { "${real_name}": ensure => $ensure, - check_command => $check_command, + check_command => $real_check_command, host_name => $host_name, use => $use, notify => Service[nagios], |