-
-
Notifications
You must be signed in to change notification settings - Fork 437
Improve support of ping on Windows #5649
Copy link
Copy link
Closed
Labels
bugUndesired behaviourUndesired behaviourconfirmedBug is confirm by dev teamBug is confirm by dev teamresolvedA fixed issueA fixed issue
Milestone
Description
Hi There,
If fping is installed in Windows, fping would rung, but the results are check/validated against the logic of Windows ping.
Line 243 in 4563aaa
| } else { |
I suggest to change the code in ping.php starting from line #243 to the following:
} else {
// -- START - Modified by MSS on 2024-01-15
// ------------------------------------
if ($fping != '' && file_exists($fping) && is_executable($fping)) {
$position = strpos($result, 'min/avg/max');
if ($position > 0) {
$output = trim(str_replace(' ms', '', substr($result, $position)));
$pieces = explode('=', $output);
$results = explode('/', $pieces[1]);
$this->ping_status = $results[1];
$this->ping_response = __('ICMP Ping Success (%s ms)', $results[1]);
return true;
} else {
$this->status = 'down';
$this->ping_response = __('ICMP ping Timed out (' . $this->host['hostname'] . '), Result [' . $result . ']');
return false;
}
} else {
$position = strpos($result, 'Minimum');
if ($position > 0) {
$output = trim(substr($result, $position));
$pieces = explode(',', $output);
$results = explode('=', $pieces[2]);
$this->ping_status = trim(str_replace('ms', '', $results[1]));
$this->ping_response = __('ICMP Ping Success (%s ms)', $this->ping_status);
return true;
} else {
$this->status = 'down';
$this->ping_response = __('ICMP ping Timed out (' . $this->host['hostname'] . '), Result [' . $result . ']');
return false;
}
}
// -- END - Modified by MSS on 2024-01-15
// ------------------------------------
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugUndesired behaviourUndesired behaviourconfirmedBug is confirm by dev teamBug is confirm by dev teamresolvedA fixed issueA fixed issue