mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
HOST-RESOURCES-MIB storage-based memory polling (COMMENTS PLEASE)
git-svn-id: http://www.observium.org/svn/observer/trunk@1026 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
<?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'];
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user