summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-07-25 14:41:51 +0000
committermh <mh@immerda.ch>2008-07-25 14:41:51 +0000
commit4228fcae4d01803981887506aebd24c1ddc0fe46 (patch)
treedb1470a202b42acfff3d2016e29d5ed6ca71dd88
parent89b7a86b1827ed98254e7f792dcd1ba6b67582fa (diff)
enhances nagios with an optional ping rate
-rw-r--r--manifests/init.pp10
1 files changed, 8 insertions, 2 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index b146a97..ea2b8aa 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -235,9 +235,10 @@ define nagios::extra_host($ip, $nagios_alias, $use = 'generic-host', $parents =
use => $use,
parents => $parents
}
+
nagios::service { "check_ping_${name}":
host_name => $name,
- check_command => "check_ping!100.0,20%!500.0,60%",
+ check_command => 'check_ping!100.0,20%!500.0,60%',
host_name => $name,
service_description => "${nagios_alias}_check_ping",
}
@@ -298,8 +299,13 @@ define nagios::service(
}
define nagios::service::ping(){
+ $real_nagios_ping_rate = $nagios_ping_rate ? {
+ '' => '!100.0,20%!500.0,60%',
+ default => $nagios_ping_rate
+ }
+
nagios::service{ "check_ping_${hostname}":
- check_command => "check_ping!100.0,20%!500.0,60%",
+ check_command => "check_ping${real_nagios_ping_rate}",
}
}