Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
715 B
PHP
Raw Permalink Normal View History

2010-02-24 14:11:51 +00:00
<?php
2012-05-25 12:24:34 +00:00
// HOST-RESOURCES-MIB - Storage Objects
if (! is_array($storage_cache['hrstorage'] ?? null)) {
2010-07-22 21:58:49 +00:00
$storage_cache['hrstorage'] = snmpwalk_cache_oid($device, 'hrStorageEntry', null, 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES');
d_echo($storage_cache);
2010-02-24 14:11:51 +00:00
}
2018-07-13 17:08:00 -05:00
$entry = $storage_cache['hrstorage'][$storage['storage_index']];
2010-02-24 14:11:51 +00:00
2020-09-22 02:52:01 +02:00
$storage['units'] = $entry['hrStorageAllocationUnits'];
$entry['hrStorageUsed'] = fix_integer_value($entry['hrStorageUsed']);
$entry['hrStorageSize'] = fix_integer_value($entry['hrStorageSize']);
2020-09-22 02:52:01 +02:00
$storage['used'] = ($entry['hrStorageUsed'] * $storage['units']);
$storage['size'] = ($entry['hrStorageSize'] * $storage['units']);
$storage['free'] = ($storage['size'] - $storage['used']);