Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
490 B
PHP
Raw Permalink Normal View History

<?php
2020-09-22 02:52:01 +02:00
if (! is_array($storage_cache['dataset'])) {
$storage_cache['dataset'] = snmpwalk_cache_oid($device, 'datasetTable', null, 'FREENAS-MIB');
d_echo($storage_cache);
}
2021-01-28 14:57:47 -05:00
$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']);