summaryrefslogtreecommitdiff
path: root/manifests/service.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-01-02 19:54:17 +0100
committermh <mh@immerda.ch>2013-01-02 19:54:17 +0100
commit8b4e71729288d25e44d8433be27dc1a5d9fe63d9 (patch)
tree5460675cf9f10df08f298c777d1e37d8fbcfbb6f /manifests/service.pp
parent4d2d0a813a718ad412fbd05da8588b8e90d0b9a3 (diff)
parent4d6b051acd53217860e1401946e45550e20c91a0 (diff)
Merge remote-tracking branch 'shared/master'
Conflicts: README manifests/service.pp
Diffstat (limited to 'manifests/service.pp')
-rw-r--r--manifests/service.pp20
1 files changed, 17 insertions, 3 deletions
diff --git a/manifests/service.pp b/manifests/service.pp
index 9eb993e..134d1f7 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -11,8 +11,11 @@ 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
@@ -25,7 +28,18 @@ define nagios::service (
if $ensure != 'absent' {
if $check_comand == 'absent' {
- fail("Must pass a check_command to ${name} if it should be present")
+ fail("Must pass a check_command to ${name} if it should be present")
+ }
+ 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}"] {