2015-05-11 14:28:54 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if (!is_array($storage_cache['netapp-storage'])) {
|
2015-07-13 20:10:26 +02:00
|
|
|
$storage_cache['netapp-storage'] = snmpwalk_cache_oid($device, 'dfEntry', null, 'NETAPP-MIB');
|
2015-08-20 15:02:40 +02:00
|
|
|
d_echo($storage_cache);
|
2015-05-11 14:28:54 +01: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'])) {
|
2015-07-13 20:10:26 +02:00
|
|
|
$storage['used'] = ($entry['df64UsedKBytes'] * $storage['units']);
|
|
|
|
$storage['size'] = ($entry['df64TotalKBytes'] * $storage['units']);
|
2015-05-11 15:54:57 +01:00
|
|
|
}
|
2015-07-13 20:10:26 +02:00
|
|
|
else {
|
|
|
|
$storage['used'] = ($entry['dfKBytesUsed'] * $storage['units']);
|
|
|
|
$storage['size'] = ($entry['dfKBytesTotal'] * $storage['units']);
|
|
|
|
}
|
|
|
|
|
|
|
|
$storage['free'] = ($storage['size'] - $storage['used']);
|