2016-11-21 07:08:38 +00:00
|
|
|
<?php
|
|
|
|
|
|
2022-08-21 16:23:43 -05:00
|
|
|
if (! is_array($storage_cache['dsk'] ?? null)) {
|
2016-11-21 07:08:38 +00:00
|
|
|
$storage_cache['dsk'] = snmpwalk_cache_oid($device, 'dskTable', null, 'UCD-SNMP-MIB');
|
|
|
|
|
d_echo($storage_cache);
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-13 17:08:00 -05:00
|
|
|
$entry = $storage_cache['dsk'][$storage['storage_index']];
|
2016-11-21 07:08:38 +00:00
|
|
|
|
2020-09-22 02:52:01 +02:00
|
|
|
$storage['units'] = 1024;
|
|
|
|
|
$storage['size'] = ($entry['dskTotal'] * $storage['units']);
|
|
|
|
|
$storage['free'] = ($entry['dskAvail'] * $storage['units']);
|
|
|
|
|
$storage['used'] = ($storage['size'] - $storage['free']);
|