diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 33c0777329..0f766a92f5 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2010-10-21 Junichi Satoh + + * lib/PandoraFMS/Tools.pm: Fixed timeout option for FreeBSD ping. + (Note: In ping6, '-t' option is not implemented. So, 'networktimeout' + is not used with ping6.) + 2010-10-21 Sergio Martin * util/recon_scripts diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index b49c3741b6..24b0c0fa01 100644 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -587,14 +587,14 @@ sub pandora_ping ($$) { } elsif ($OSNAME eq "freebsd"){ - my $ping_command = "ping"; + my $ping_command = "ping -t $pa_config->{'networktimeout'}"; if ($host =~ /\d+:|:\d+/ ) { $ping_command = "ping6"; } # Ping the host - `$ping_command -q -i $pa_config->{'networktimeout'} -n -c $pa_config->{'icmp_checks'} $host >/dev/null 2>&1`; + `$ping_command -q -n -c $pa_config->{'icmp_checks'} $host >/dev/null 2>&1`; return ($? == 0) ? 1 : 0; } @@ -658,14 +658,14 @@ sub pandora_ping_latency ($$) { } elsif ($OSNAME eq "freebsd"){ - my $ping_command = "ping"; + my $ping_command = "ping -t $pa_config->{'networktimeout'}"; if ($host =~ /\d+:|:\d+/ ) { $ping_command = "ping6"; } # Ping the host - my @output = `$ping_command -q -i $pa_config->{'networktimeout'} -n -c $pa_config->{'icmp_checks'} $host 2>/dev/null`; + my @output = `$ping_command -q -n -c $pa_config->{'icmp_checks'} $host 2>/dev/null`; # Something went wrong return 0 if ($? != 0);