Files

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

20 lines
719 B
PHP
Raw Permalink Normal View History

<?php
2020-09-22 02:52:01 +02:00
if (! is_array($storage_cache['netapp-storage'])) {
2015-05-11 15:54:57 +01:00
$storage_cache['netapp-storage'] = snmpwalk_cache_oid($device, 'dfEntry', null, 'NETAPP-MIB');
d_echo($storage_cache);
}
2018-07-13 17:08:00 -05:00
$entry = $storage_cache['netapp-storage'][$storage['storage_index']];
$storage['units'] = 1024;
2015-05-11 15:54:57 +01:00
if (isset($entry['df64TotalKBytes']) && is_numeric($entry['df64TotalKBytes'])) {
$storage['used'] = ($entry['df64UsedKBytes'] * $storage['units']);
$storage['size'] = ($entry['df64TotalKBytes'] * $storage['units']);
} else {
$storage['used'] = ($entry['dfKBytesUsed'] * $storage['units']);
2015-05-11 15:54:57 +01:00
$storage['size'] = ($entry['dfKBytesTotal'] * $storage['units']);
2015-07-13 20:10:26 +02:00
}
$storage['free'] = ($storage['size'] - $storage['used']);