2010-10-21 Junichi Satoh <junichi@rworks.jp>

* 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.)



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3440 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2010-10-21 10:12:38 +00:00
parent 57c7683deb
commit fe0c0dbb3f
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2010-10-21 Junichi Satoh <junichi@rworks.jp>
* 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 <sergio.martin@artica.es> 2010-10-21 Sergio Martin <sergio.martin@artica.es>
* util/recon_scripts * util/recon_scripts

View File

@ -587,14 +587,14 @@ sub pandora_ping ($$) {
} }
elsif ($OSNAME eq "freebsd"){ elsif ($OSNAME eq "freebsd"){
my $ping_command = "ping"; my $ping_command = "ping -t $pa_config->{'networktimeout'}";
if ($host =~ /\d+:|:\d+/ ) { if ($host =~ /\d+:|:\d+/ ) {
$ping_command = "ping6"; $ping_command = "ping6";
} }
# Ping the host # 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; return ($? == 0) ? 1 : 0;
} }
@ -658,14 +658,14 @@ sub pandora_ping_latency ($$) {
} }
elsif ($OSNAME eq "freebsd"){ elsif ($OSNAME eq "freebsd"){
my $ping_command = "ping"; my $ping_command = "ping -t $pa_config->{'networktimeout'}";
if ($host =~ /\d+:|:\d+/ ) { if ($host =~ /\d+:|:\d+/ ) {
$ping_command = "ping6"; $ping_command = "ping6";
} }
# Ping the host # 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 # Something went wrong
return 0 if ($? != 0); return 0 if ($? != 0);