From 4228fcae4d01803981887506aebd24c1ddc0fe46 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 25 Jul 2008 14:41:51 +0000 Subject: enhances nagios with an optional ping rate --- manifests/init.pp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'manifests/init.pp') 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}", } } -- cgit v1.2.3