summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/command/nrpe_timeout.pp11
-rw-r--r--manifests/service.pp13
2 files changed, 19 insertions, 5 deletions
diff --git a/manifests/command/nrpe_timeout.pp b/manifests/command/nrpe_timeout.pp
new file mode 100644
index 0000000..3415566
--- /dev/null
+++ b/manifests/command/nrpe_timeout.pp
@@ -0,0 +1,11 @@
+class nagios::command::nrpe_timeout {
+ nagios_command {
+ 'check_nrpe_timeout':
+ command_line => '/usr/lib/nagios/plugins/check_nrpe -t $ARG1$ -H $HOSTADDRESS$ -c $ARG2$ -a $ARG3$'
+ }
+
+ nagios_command {
+ 'check_nrpe_1arg_timeout':
+ command_line => '/usr/lib/nagios/plugins/check_nrpe -t $ARG1$ -H $HOSTADDRESS$ -c $ARG2$'
+ }
+}
diff --git a/manifests/service.pp b/manifests/service.pp
index ae112c1..55b2254 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -13,7 +13,8 @@ define nagios::service (
$use = 'generic-service',
$service_description = 'absent',
$use_nrpe = '',
- $nrpe_args = '' )
+ $nrpe_args = '',
+ $nrpe_timeout = 10 )
{
# TODO: this resource should normally accept all nagios_host parameters
@@ -21,11 +22,13 @@ define nagios::service (
$real_name = "${hostname}_${name}"
if ($use_nrpe == 'true') {
- if ($nrpe_args != '') {
- $real_check_command = "check_nrpe!$check_command!\"$nrpe_args\""
+ 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!$check_command"
+ else {
+ $real_check_command = "check_nrpe_1arg_timeout!$nrpe_timeout!$check_command"
}
}
else {