From faf85fa479e63b50cc2a3a7e69db9c0d7eb6e9ca Mon Sep 17 00:00:00 2001 From: nadir Date: Sun, 12 Dec 2010 23:12:53 +0100 Subject: Added NRPE Support for nagios::service --- manifests/service.pp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'manifests/service.pp') diff --git a/manifests/service.pp b/manifests/service.pp index afc8650..6f82279 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -11,16 +11,25 @@ define nagios::service ( $notification_options = '', $contact_groups = '', $use = 'generic-service', - $service_description = 'absent' ) + $service_description = 'absent', + $use_nrpe = '', + $nrpe_args = '' ) { # TODO: this resource should normally accept all nagios_host parameters $real_name = "${hostname}_${name}" + if ($use_nrpe == 'true') { + $real_check_command = "check_nrpe!$check_command!\"$nrpe_args\"" + } + 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], -- cgit v1.2.3