2010-02-24 14:11:51 +00:00
|
|
|
<?php
|
|
|
|
|
2012-05-25 12:24:34 +00:00
|
|
|
// HOST-RESOURCES-MIB - Storage 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');
|
2015-08-20 15:02:40 +02:00
|
|
|
d_echo($storage_cache);
|
2010-02-24 14:11:51 +00:00
|
|
|
}
|
|
|
|
|
2010-08-11 17:08:56 +00:00
|
|
|
$entry = $storage_cache['hrstorage'][$storage[storage_index]];
|
2010-02-24 14:11:51 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$storage['units'] = $entry['hrStorageAllocationUnits'];
|
2015-06-02 17:36:10 +01:00
|
|
|
$entry['hrStorageUsed'] = fix_integer_value($entry['hrStorageUsed']);
|
|
|
|
$entry['hrStorageSize'] = fix_integer_value($entry['hrStorageSize']);
|
2015-07-13 20:10:26 +02:00
|
|
|
$storage['used'] = ($entry['hrStorageUsed'] * $storage['units']);
|
|
|
|
$storage['size'] = ($entry['hrStorageSize'] * $storage['units']);
|
|
|
|
$storage['free'] = ($storage['size'] - $storage['used']);
|