mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Revivied codes to improve ping performance that was degraded in
Pandora FMS 4.0.
This commit is contained in:
parent
308c538dd7
commit
49cdb38f90
@ -872,9 +872,12 @@ sub pandora_ping ($$$$) {
|
|||||||
# Windows XP .. Windows 7
|
# Windows XP .. Windows 7
|
||||||
if (($OSNAME eq "MSWin32") || ($OSNAME eq "MSWin32-x64") || ($OSNAME eq "cygwin")){
|
if (($OSNAME eq "MSWin32") || ($OSNAME eq "MSWin32-x64") || ($OSNAME eq "cygwin")){
|
||||||
my $ms_timeout = $timeout * 1000;
|
my $ms_timeout = $timeout * 1000;
|
||||||
$output = `ping -n $retries -w $ms_timeout $host`;
|
for ($i=0; $i < $retries; $i++) {
|
||||||
if ($output =~ /TTL/){
|
$output = `ping -n 1 -w $ms_timeout $host`;
|
||||||
return 1;
|
if ($output =~ /TTL/){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
sleep 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -890,9 +893,12 @@ sub pandora_ping ($$$$) {
|
|||||||
# 'networktimeout' is not used by ping on Solaris.
|
# 'networktimeout' is not used by ping on Solaris.
|
||||||
|
|
||||||
# Ping the host
|
# Ping the host
|
||||||
`$ping_command -s -n $host 56 $retries >$DEVNULL 2>&1`;
|
for ($i=0; $i < $retries; $i++) {
|
||||||
if ($? == 0) {
|
`$ping_command -s -n $host 56 1 >$DEVNULL 2>&1`;
|
||||||
return 1;
|
if ($? == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
sleep 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -908,9 +914,12 @@ sub pandora_ping ($$$$) {
|
|||||||
# 'networktimeout' is not used by ping6 on FreeBSD.
|
# 'networktimeout' is not used by ping6 on FreeBSD.
|
||||||
|
|
||||||
# Ping the host
|
# Ping the host
|
||||||
`$ping_command -q -n -c $retries $host >$DEVNULL 2>&1`;
|
for ($i=0; $i < $retries; $i++) {
|
||||||
if ($? == 0) {
|
`$ping_command -q -n -c 1 $host >$DEVNULL 2>&1`;
|
||||||
return 1;
|
if ($? == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
sleep 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -926,9 +935,12 @@ sub pandora_ping ($$$$) {
|
|||||||
# 'networktimeout' is not used by ping6 on NetBSD.
|
# 'networktimeout' is not used by ping6 on NetBSD.
|
||||||
|
|
||||||
# Ping the host
|
# Ping the host
|
||||||
`$ping_command -q -n -c $retries $host >$DEVNULL 2>&1`;
|
for ($i=0; $i < $retries; $i++) {
|
||||||
if ($? == 0) {
|
`$ping_command -q -n -c 1 $host >$DEVNULL 2>&1`;
|
||||||
return 1;
|
if ($? == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
sleep 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -943,9 +955,12 @@ sub pandora_ping ($$$$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Ping the host
|
# Ping the host
|
||||||
`$ping_command -q -W $timeout -n -c $retries $host >$DEVNULL 2>&1`;
|
for ($i=0; $i < $retries; $i++) {
|
||||||
if ($? == 0) {
|
`$ping_command -q -W $timeout -n -c 1 $host >$DEVNULL 2>&1`;
|
||||||
return 1;
|
if ($? == 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
sleep 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user