Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Cacti CHANGELOG
-issue#5856: Help HTML file is incorrect for Automation Networks
-issue#5867: Disabling a Tree does not function as expected
-issue#5868: Error when remove Orphaned Graphs from GUI
-issue#5869: Fix FreeBSD IPv6 ping
-issue#5870: CLI utility splice_rrd.php generates an error in PHP8+

1.2.28
Expand Down
7 changes: 5 additions & 2 deletions lib/ping.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function ping_icmp() {
$result = shell_exec('ping -t ' . ceil($this->timeout/1000) . ' -c ' . $this->retries . ' ' . $this->host['hostname']);
} elseif (substr_count(strtolower(PHP_OS), 'freebsd')) {
if (strpos($host_ip, ':') !== false) {
$result = shell_exec('/usr/sbin/ping6 -x ' . $this->timeout . ' -c ' . $this->retries . ' ' . $this->host['hostname']);
$result = shell_exec('ping6 -t ' . $this->timeout . ' -c ' . $this->retries . ' ' . $this->host['hostname']);
} else {
$result = shell_exec('ping -W ' . $this->timeout . ' -c ' . $this->retries . ' ' . $this->host['hostname']);
}
Expand All @@ -189,7 +189,7 @@ function ping_icmp() {
* as it now tries to open an ICMP socket and fails
* $result will be empty, then. */
if (strpos($host_ip, ':') !== false) {
$result = shell_exec('/usr/sbin/ping6 -W ' . ceil($this->timeout/1000) . ' -c ' . $this->retries . ' -p ' . $pattern . ' ' . $this->host['hostname']);
$result = shell_exec('ping -6 -W ' . ceil($this->timeout/1000) . ' -c ' . $this->retries . ' -p ' . $pattern . ' ' . $this->host['hostname']);
} else {
$result = shell_exec('ping -W ' . ceil($this->timeout/1000) . ' -c ' . $this->retries . ' -p ' . $pattern . ' ' . $this->host['hostname'] . ' 2>&1');
if ((strpos($result, 'unknown host') !== false || strpos($result, 'Address family') !== false) && file_exists('/bin/ping6')) {
Expand Down Expand Up @@ -745,6 +745,9 @@ function strip_ip_address($ip_address) {
$ip_address = str_replace('tcp:', '', strtolower($ip_address));
} elseif (strpos($ip_address, 'udp:') !== false) {
$ip_address = str_replace('udp:', '', strtolower($ip_address));
} elseif (strpos($ip_address, '[') !== false) {
$parts = explode(']', $ip_address);
$ip_address = trim($parts[0], '[');
}

return $ip_address;
Expand Down
Loading