2010-03-14 13:50:14 +00:00
|
|
|
<?php
|
|
|
|
|
2012-05-25 12:24:34 +00:00
|
|
|
// HOST-RESOURCES-MIB - Memory Objects
|
2015-07-13 20:10:26 +02:00
|
|
|
if (!is_array($storage_cache['hrstorage'])) {
|
|
|
|
$storage_cache['hrstorage'] = snmpwalk_cache_oid($device, 'hrStorageEntry', null, 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES');
|
|
|
|
if ($debug) {
|
|
|
|
print_r($storage_cache);
|
|
|
|
}
|
2011-03-15 12:04:26 +00:00
|
|
|
}
|
2015-07-13 20:10:26 +02:00
|
|
|
else {
|
|
|
|
if ($debug) {
|
|
|
|
echo 'Cached!';
|
|
|
|
}
|
2011-03-15 12:04:26 +00:00
|
|
|
}
|
2010-03-14 13:50:14 +00:00
|
|
|
|
2010-08-11 17:08:56 +00:00
|
|
|
$entry = $storage_cache['hrstorage'][$mempool[mempool_index]];
|
2010-03-14 13:50:14 +00:00
|
|
|
|
|
|
|
$mempool['units'] = $entry['hrStorageAllocationUnits'];
|
2015-07-13 20:10:26 +02:00
|
|
|
$mempool['used'] = ($entry['hrStorageUsed'] * $mempool['units']);
|
|
|
|
$mempool['total'] = ($entry['hrStorageSize'] * $mempool['units']);
|
|
|
|
$mempool['free'] = ($mempool['total'] - $mempool['used']);
|