librenms-librenms/includes/polling/storage-hrstorage.inc.php
Adam Amstrong e220114f4c add some mibs, update snmp functions
git-svn-id: http://www.observium.org/svn/observer/trunk@1458 61d68cd4-352d-0410-923a-c4978735b2b8
2010-07-22 21:58:49 +00:00

18 lines
596 B
PHP
Executable File

<?php
### HOST-RESOURCES-MIB - Storage Objects
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); }
}
$entry = $storage_cache['hrstorage'][$device[device_id]][$storage[storage_index]];
$storage['units'] = $entry['hrStorageAllocationUnits'];
$storage['used'] = $entry['hrStorageUsed'] * $storage['units'];
$storage['size'] = $entry['hrStorageSize'] * $storage['units'];
$storage['free'] = $storage['size'] - $storage['used'];
?>