mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Update to fix reporting with multiple zpools Removed the foreach loop to prevent erroneous reporting when multiple zpools are polled. * Update to fix reporting with multiple datasets Removed the foreach loop to prevent erroneous reporting when multiple datasets are polled. * updated test data Co-authored-by: Tony Murray <murraytony@gmail.com>
14 lines
490 B
PHP
14 lines
490 B
PHP
<?php
|
|
|
|
if (! is_array($storage_cache['dataset'])) {
|
|
$storage_cache['dataset'] = snmpwalk_cache_oid($device, 'datasetTable', null, 'FREENAS-MIB');
|
|
d_echo($storage_cache);
|
|
}
|
|
|
|
$entry = $storage_cache['dataset'][$storage['storage_index']];
|
|
|
|
$storage['units'] = $entry['datasetAllocationUnits'];
|
|
$storage['size'] = ($entry['datasetSize'] * $storage['units']);
|
|
$storage['free'] = ($entry['datasetAvailable'] * $storage['units']);
|
|
$storage['used'] = ($storage['size'] - $storage['free']);
|