mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* refactor: Centralize MIB include directory specification The default is now: ``` $config['mib_dir'].'/mibdirname:'.$config['mib_dir'] ``` This means we exclude OS mibs and only use ours (we could prepend `+` if we want to include os mibs. All snmp calls should only include the name of the subdirectory under the mibs directory. * Remove d_echo from Proc Fix snmpsim tests.
26 lines
882 B
PHP
26 lines
882 B
PHP
<?php
|
|
|
|
$oid = $mempool['mempool_index'];
|
|
|
|
d_echo('Huawei VRP Mempool');
|
|
|
|
if (!is_array($mempool_cache['vrp'])) {
|
|
d_echo('caching');
|
|
|
|
$mempool_cache['vrp'] = array();
|
|
$mempool_cache['vrp'] = snmpwalk_cache_multi_oid($device, 'hwEntityMemSize', $mempool_cache['vrp'], 'HUAWEI-ENTITY-EXTENT-MIB', 'huawei');
|
|
$mempool_cache['vrp'] = snmpwalk_cache_multi_oid($device, 'hwEntityMemUsage', $mempool_cache['vrp'], 'HUAWEI-ENTITY-EXTENT-MIB', 'huawei');
|
|
d_echo($mempool_cache);
|
|
}
|
|
|
|
$entry = $mempool_cache['vrp'][$mempool[mempool_index]];
|
|
|
|
if ($entry['hwEntityMemSize'] < 0) {
|
|
$entry['hwEntityMemSize'] = ($entry['hwEntityMemSize'] * -1);
|
|
}
|
|
|
|
$perc = $entry['hwEntityMemUsage'];
|
|
$mempool['total'] = $entry['hwEntityMemSize'];
|
|
$mempool['used'] = ($entry['hwEntityMemSize'] / 100 * $perc);
|
|
$mempool['free'] = ($entry['hwEntityMemSize'] - $mempool['used']);
|