Skip to content

Commit d395e6a

Browse files
committed
Fixing Cacti#5475 - Issue with ss_fping.php and PHP8 strict typing (Cacti#5477)
* QA: Broken Function * QA: Two additional QA Items - Do a check for IP address as dns_get_records() does not have a timeout and I don't use DNS - Properly display information about MariaDB 11. * Fixing Cacti#5475 - Ping Issues with Advanced Ping an PHP8 PHP 8.x error - Unsupported operand types: float + string * QA: Fix two typos
1 parent 229fa03 commit d395e6a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ Cacti CHANGELOG
165165
-issue#5462: Package preview aparantely making changes to Cacti Templates or there is a Caching issue
166166
-issue#5466: When enabling boost on a fresh install, we get a single error in the Cacti log
167167
-issue#5467: Cacti logging throws error when attempting to generate a log message from empty log string in PHP 8.x
168+
-issue#5475: PHP 8.x error - Unsupported operand types: float + string
168169
-feature#5375: Add template for Fortinet firewall and Aruba Instant cluster
169170
-feature#5393: Add template for SNMP printer
170171
-feature#5418: Display device class before package import

include/global_settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,12 +2393,12 @@
23932393
)
23942394
),
23952395
'extended_paths_header' => array(
2396-
'friendly_name' => __('Structured RRDfile Paths'),
2396+
'friendly_name' => __('Structure RRDfile Paths'),
23972397
'method' => 'spacer',
23982398
'collapsible' => 'true'
23992399
),
24002400
'extended_paths' => array(
2401-
'friendly_name' => __('Method'),
2401+
'friendly_name' => __('Enable Structured Paths'),
24022402
'description' => __('Use a separate subfolder for each hosts RRD files. The naming of the RRDfiles will be one of the following:<br><ul><li>&lt;path_cacti&gt;/rra/host_id/local_data_id.rrd,</li><li>&lt;path_cacti&gt;/rra/device_id/data_query_id/local_data_id.rrd,</li><li>&lt;path_cacti&gt;/rra/device_hash/device_id/local_data_id.rrd,</li><li>&lt;path_cacti&gt;/rra/device_hash/device_id/data_query_id/local_data_id.rrd.</li></ul><br>You can make this change after install by running the CLI script <b>structure_rra_paths.php</b> after you make the change. NOTE: If you change Max Directories value to decrease the number of directories, or if you change the Directory Pattern, empty directories will not be pruned after you rerun the <b>structure_rra_paths.php</b> script.'),
24032403
'method' => 'checkbox'
24042404
),

scripts/ss_fping.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,18 @@ function ss_fping($hostname = '', $ping_sweeps = 6, $ping_type = 'ICMP', $port =
8585
$i = 0;
8686

8787
while ($i < $ping_sweeps) {
88+
$start = microtime(true);
8889
$result = $ping->ping(AVAIL_PING, $method, $ping_timeout, 1);
90+
$end = microtime(true);
8991

9092
if (!$result) {
93+
// Error response
9194
$failed_results++;
92-
} else {
93-
$time[$i] = $ping->ping_status;
95+
96+
$time[$i] = $end - $start;
97+
$total_time += $end - $start;
98+
} elseif (is_numeric($ping->ping_status)) {
99+
$time[$i] = $ping->ping_status;
94100
$total_time += $ping->ping_status;
95101

96102
if ($ping->ping_status < $min) {

0 commit comments

Comments
 (0)