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:
Tony Murray
2021-03-12 18:10:14 -06:00
committed by GitHub
parent 13c5745ae8
commit 61316ce2cc
81 changed files with 2578 additions and 3353 deletions

View File

@@ -10,24 +10,18 @@
$aix_filesystem = snmpwalk_cache_oid($device, 'aixFsTableEntry', [], 'IBM-AIX-MIB');
$sql = "SELECT `storage_descr` FROM `storage` WHERE `device_id` = '" . $device['device_id'] . "' AND `storage_type` != 'aixFileSystem'";
$tmp_storage = dbFetchColumn($sql);
if (is_array($aix_filesystem)) {
echo 'aix_filesystem : ';
foreach ($aix_filesystem as $aix_fs) {
if (isset($aix_fs['aixFsMountPoint'])) {
if ($aix_fs['aixFsType'] == 'jfs' || $aix_fs['aixFsType'] == 'jfs2') { // Only JFS or JFS2
if (! in_array($aix_fs['aixFsMountPoint'], $tmp_storage)) {
$aix_fs['aixFsSize'] = $aix_fs['aixFsSize'] * 1024 * 1024;
$aix_fs['aixFsFree'] = $aix_fs['aixFsFree'] * 1024 * 1024;
$aix_fs['aixFsUsed'] = $aix_fs['aixFsSize'] - $aix_fs['aixFsFree'];
$aix_fs['aixFsSize'] = $aix_fs['aixFsSize'] * 1024 * 1024;
$aix_fs['aixFsFree'] = $aix_fs['aixFsFree'] * 1024 * 1024;
$aix_fs['aixFsUsed'] = $aix_fs['aixFsSize'] - $aix_fs['aixFsFree'];
discover_storage($valid_storage, $device, $aix_fs['aixFsIndex'], 'aixFileSystem', 'aix', $aix_fs['aixFsMountPoint'], $aix_fs['aixFsSize'], 1024 * 1024, $aix_fs['aixFsUsed']);
}
discover_storage($valid_storage, $device, $aix_fs['aixFsIndex'], 'aixFileSystem', 'aix', $aix_fs['aixFsMountPoint'], $aix_fs['aixFsSize'], 1024 * 1024, $aix_fs['aixFsUsed']);
}
}
unset($tmp_storage, $aix_fs);
} // end foreach
} // endif
unset($aix_fs);

View File

@@ -28,7 +28,7 @@ if ($device['os'] == 'equalogic') {
} else {
// Trying to search the last '.' and take something after it as index
$arrindex = explode('.', $index);
$newindex = (int) (end($arrindex)) + 0;
$newindex = (int) cast_number(end($arrindex));
if (is_int($newindex)) {
discover_storage($valid_storage, $device, $newindex, $fstype, 'eql-storage', $descr, $size, $units, $used);
}