Files
Jellyfrog b6620746c5 Miscellaneous cleanup - part 5 (#14502)
* Miscellaneous cleanup - part 5

* Update includes/discovery/sensors/pre-cache/ipoman.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>

* Update ipoman.inc.php

* string for trim()

* Update ciscosb.inc.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2022-10-25 19:27:28 +02:00

17 lines
709 B
PHP

<?php
// HOST-RESOURCES-MIB - Storage Objects
if (! isset($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'] ?? 0);
$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']);