mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
PHP 8 fixes (#12528)
* port related errors * more fixes * fix storage count * add tests for php8 * style * only need not empty * aix fixes.... * storage WIP * fix aix discovering hrstorage fix db test adding .gitkeep fix os modules when discovery only * fix aos processors wrong oid * fix mempool number casting * fix aos7 cpu * use + 0 cast instead of floatval() * more verbose error on invalid json * remove invalid data in json * actually fix the json * correct json error fix * cast_number() function fix aruba-instant and aos6 bugs exposed by new function, probably more... * fix a-f fix inadequate sort for component data * fix global port poll time * fix mempools precent 0, route count, ntp const * fix schleifenbauer liberal current usage * further number casting refinement * vrp * fix tests * fix arbos * warn cleanups adjust to :: change * fix ciena-sds * fix drac * fix dell-rpdu anddlink * fix and improve arubaos better error when getting an array in Processor * fix atenpdu, add missing arubaos files * aruba-instant to yaml apparently I didn't need to do this, the diff just looks really odd It did add ranged sub-index replacements * docker app, was completely wrong... fixed * fix sentry4 divide by 0... * fixed root issue, remove check * nicer cidr in ipv6 code * remove bogus enuxus battery bank skip_values * Fix InfluxDB tests * remove extra import * fix other style issues. * influx "style" fixes
This commit is contained in:
@@ -516,10 +516,12 @@ foreach ($port_stats as $ifIndex => $port) {
|
||||
echo "\n";
|
||||
|
||||
// get last poll time to optimize poll_time, poll_prev and poll_period in table db
|
||||
$prev_poll_times = array_filter(array_column($ports, 'poll_time'));
|
||||
$max_poll_time_prev = empty($prev_poll_times) ? null : max($prev_poll_times);
|
||||
$device_global_ports = [
|
||||
'poll_time' => $polled,
|
||||
'poll_prev' => max(array_column($ports, 'poll_time')),
|
||||
'poll_period' => ($polled - $port['poll_time']),
|
||||
'poll_prev' => $max_poll_time_prev,
|
||||
'poll_period' => $max_poll_time_prev ? null : ($polled - $max_poll_time_prev),
|
||||
];
|
||||
|
||||
$globally_updated_port_ids = [];
|
||||
|
Reference in New Issue
Block a user