mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
18 lines
629 B
PHP
18 lines
629 B
PHP
|
<?php
|
||
|
|
||
|
/// HOST-RESOURCES-MIB - Memory Objects
|
||
|
|
||
|
if(!is_array($storage_cache['hrstorage'])) {
|
||
|
$storage_cache['hrstorage'] = snmp_cache_oid("hrStorageEntry", $device, array(), "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES");
|
||
|
if ($debug) { print_r($storage_cache); }
|
||
|
} else { if($debug) { echo("Cached!"); } }
|
||
|
|
||
|
$entry = $storage_cache['hrstorage'][$device[device_id]][$mempool[index]];
|
||
|
|
||
|
$mempool['units'] = $entry['hrStorageAllocationUnits'];
|
||
|
$mempool['used'] = $entry['hrStorageUsed'] * $mempool['units'];
|
||
|
$mempool['total'] = $entry['hrStorageSize'] * $mempool['units'];
|
||
|
$mempool['free'] = $mempool['total'] - $mempool['used'];
|
||
|
|
||
|
?>
|