mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Add PHP CS Fixer Based on https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200 * Apply PHP CS
17 lines
707 B
PHP
17 lines
707 B
PHP
<?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');
|
|
d_echo($storage_cache);
|
|
}
|
|
|
|
$entry = $storage_cache['hrstorage'][$storage['storage_index']];
|
|
|
|
$storage['units'] = $entry['hrStorageAllocationUnits'];
|
|
$entry['hrStorageUsed'] = fix_integer_value($entry['hrStorageUsed']);
|
|
$entry['hrStorageSize'] = fix_integer_value($entry['hrStorageSize']);
|
|
$storage['used'] = ($entry['hrStorageUsed'] * $storage['units']);
|
|
$storage['size'] = ($entry['hrStorageSize'] * $storage['units']);
|
|
$storage['free'] = ($storage['size'] - $storage['used']);
|