2010-03-14 13:50:14 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/// HOST-RESOURCES-MIB - Memory Objects
|
|
|
|
|
2011-03-15 12:04:26 +00:00
|
|
|
if (!is_array($storage_cache['hrstorage']))
|
|
|
|
{
|
2010-07-22 21:58:49 +00:00
|
|
|
$storage_cache['hrstorage'] = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES");
|
2010-03-14 13:50:14 +00:00
|
|
|
if ($debug) { print_r($storage_cache); }
|
2011-03-15 12:04:26 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ($debug) { echo("Cached!"); }
|
|
|
|
}
|
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'];
|
|
|
|
$mempool['used'] = $entry['hrStorageUsed'] * $mempool['units'];
|
|
|
|
$mempool['total'] = $entry['hrStorageSize'] * $mempool['units'];
|
|
|
|
$mempool['free'] = $mempool['total'] - $mempool['used'];
|
|
|
|
|
2011-03-15 12:04:26 +00:00
|
|
|
?>
|