librenms/includes/discovery/processors/vrp.inc.php
Tony Murray edbb6ae0e3 refactor: Centralize MIB include directory specification (#4603)
* 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.
2016-09-28 14:19:28 +01:00

28 lines
1.3 KiB
PHP

<?php
// Huawei VRP Processors
if ($device['os'] == 'vrp') {
echo 'Huawei VRP ';
$processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityCpuUsage', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', 'huawei');
$processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityMemSize', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', 'huawei');
$processors_array = snmpwalk_cache_multi_oid($device, 'hwEntityBomEnDesc', $processors_array, 'HUAWEI-ENTITY-EXTENT-MIB', 'huawei');
d_echo($processors_array);
if (is_array($processors_array)) {
foreach ($processors_array as $index => $entry) {
if ($entry['hwEntityMemSize'] != 0) {
d_echo($index.' '.$entry['hwEntityBomEnDesc'].' -> '.$entry['hwEntityCpuUsage'].' -> '.$entry['hwEntityMemSize']."\n");
$usage_oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.'.$index;
$descr = $entry['hwEntityBomEnDesc'];
$usage = $entry['hwEntityCpuUsage'];
if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') {
discover_processor($valid['processor'], $device, $usage_oid, $index, 'vrp', $descr, '1', $usage, null, null);
}
} //end if
} //end foreach
} //end if
} //end if
unset($processors_array);