Feature: Collect VRP Entity details in the Huawei MIB (#8888)

* Feature: Collect VRP Entity details in the Huawei MIB

* Feature: Collect VRP Entity details in the Huawei MIB - Add Test Data

* Renaming of the test file vrp_5720_vrf.snmprec

* Added json test files

* Update vrp_5720_vrf.snmprec

* Update vrp_5720_vrf.snmprec

* Update vrp_5720_vrf.json

* Updated processor and mempool discovery to limit descr field

* Updated test

* Updated tests again

* Updated json test data

* Update vrp_ce12804-entity.json

* Update vrp_ce12804-entity.json

* Update vrp_5720_vrf.json
This commit is contained in:
PipoCanaja 2018-09-11 06:07:45 +02:00 committed by Tony Murray
parent d475665601
commit 5dae25b48b
7 changed files with 64087 additions and 1 deletions

View File

@ -23,7 +23,6 @@
* @author Tony Murray <murraytony@gmail.com>
*/
namespace LibreNMS\Device;
use LibreNMS\Config;
@ -147,6 +146,11 @@ class Processor extends Model implements DiscoveryModule, PollerModule, Discover
$processors = $os->discoverProcessors();
}
foreach ($processors as $processor) {
$processor->processor_descr = substr($processor->processor_descr, 0, 64);
$processors[] = $processor;
}
if (isset($processors) && is_array($processors)) {
self::sync(
$os->getDeviceId(),

View File

@ -19,6 +19,12 @@ if ($device['os'] == 'junos') {
$entity_array = snmpwalk_cache_twopart_oid($device, 'entAliasMappingIdentifier', $entity_array, 'ENTITY-MIB:IF-MIB');
}
}
if ($device['os'] == 'vrp') {
echo ' hwEntityBoardType';
$entity_array = snmpwalk_cache_oid($device, 'hwEntityBoardType', $entity_array, 'ENTITY-MIB:HUAWEI-ENTITY-EXTENT-MIB');
echo ' hwEntityBomEnDesc';
$entity_array = snmpwalk_cache_oid($device, 'hwEntityBomEnDesc', $entity_array, 'ENTITY-MIB:HUAWEI-ENTITY-EXTENT-MIB');
}
foreach ($entity_array as $entPhysicalIndex => $entry) {
if ($device['os'] == 'junos') {
@ -59,6 +65,23 @@ foreach ($entity_array as $entPhysicalIndex => $entry) {
$entPhysicalAlias = $entry['tmnxHwAlias'];
$entPhysicalAssetID = $entry['tmnxHwAssetID'];
$entPhysicalIndex = str_replace('.', '', $entPhysicalIndex);
} elseif ($device['os'] == 'vrp') {
//Add some details collected in the VRP Entity Mib
$entPhysicalDescr = $entry['hwEntityBomEnDesc'];
$entPhysicalContainedIn = $entry['entPhysicalContainedIn'];
$entPhysicalClass = $entry['entPhysicalClass'];
$entPhysicalName = $entry['entPhysicalName'];
$entPhysicalSerialNum = $entry['entPhysicalSerialNum'];
$entPhysicalModelName = $entry['hwEntityBoardType'];
$entPhysicalMfgName = $entry['entPhysicalMfgName'];
$entPhysicalVendorType = $entry['entPhysicalVendorType'];
$entPhysicalParentRelPos = $entry['entPhysicalParentRelPos'];
$entPhysicalHardwareRev = $entry['entPhysicalHardwareRev'];
$entPhysicalFirmwareRev = $entry['entPhysicalFirmwareRev'];
$entPhysicalSoftwareRev = $entry['entPhysicalSoftwareRev'];
$entPhysicalIsFRU = $entry['entPhysicalIsFRU'];
$entPhysicalAlias = $entry['entPhysicalAlias'];
$entPhysicalAssetID = $entry['entPhysicalAssetID'];
} else {
$entPhysicalDescr = $entry['entPhysicalDescr'];
$entPhysicalContainedIn = $entry['entPhysicalContainedIn'];

View File

@ -665,6 +665,9 @@ function discover_processor(&$valid, $device, $oid, $index, $type, $descr, $prec
function discover_mempool(&$valid, $device, $index, $type, $descr, $precision = '1', $entPhysicalIndex = null, $hrDeviceIndex = null)
{
$descr = substr($descr, 0, 64);
d_echo("Discover Mempool: $index, $type, $descr, $precision, $entPhysicalIndex, $hrDeviceIndex\n");
// FIXME implement the mempool_perc, mempool_used, etc.

37613
tests/data/vrp_5720_vrf.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
{
"os": {
"discovery": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.2011.2.239.1",
"sysDescr": "Huawei Versatile Routing Platform Software\nVRP (R) software, Version 8.150 (CE12800 V200R002C50SPC800) \r\nCopyright (C) 2012-2017 Huawei Technologies Co., Ltd. \r\nHUAWEICE12804",
"sysContact": null,
"version": null,
"hardware": null,
"features": null,
"location": null,
"os": "vrp",
"type": "network",
"serial": null,
"icon": "huawei.svg"
}
]
},
"poller": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.2011.2.239.1",
"sysDescr": "Huawei Versatile Routing Platform Software\nVRP (R) software, Version 8.150 (CE12800 V200R002C50SPC800) \r\nCopyright (C) 2012-2017 Huawei Technologies Co., Ltd. \r\nHUAWEICE12804",
"sysContact": "<private>",
"version": "8.150 (CE12800 V200R002C50SPC800)",
"hardware": "",
"features": null,
"location": "<private>",
"os": "vrp",
"type": "network",
"serial": null,
"icon": "huawei.svg"
}
]
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff