Hi,
I’m having issues adding Huawei VRP switchblades to LibreNMS. addhost.php reports that it does not get a SNMP response but a snmpwalk using the same credentials works. Looked into the code and isSNMPable in includes/functions.php seems to lookup sysObjectID.0 and Huawei returns an empty response to this lookup. Changed sysObjectID.0 to sysDescr.0 and that seems to work.
I don’t like making changes to built-in files like this so I was wondering what the correct solution is. includes/definitions/vrp.yaml already mentions sysDescr instead of sysObjectID, shouldn’t isSNMPable check this YAML file?
# sudo -u librenms ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS | 1.45-8-g7a422e9
DB Schema | 270
PHP | 7.2.11
MySQL | 5.5.60-MariaDB
RRDTool | 1.4.8
SNMP | NET-SNMP 5.7.2
====================================
[OK] Composer Version: 1.7.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
bootstrap/cache/.gitignore
includes/functions.php
logs/.gitignore
rrd/.gitignore
storage/app/.gitignore
storage/app/public/.gitignore
storage/debugbar/.gitignore
storage/framework/cache/.gitignore
storage/framework/sessions/.gitignore
storage/framework/testing/.gitignore
storage/framework/views/.gitignore
storage/logs/.gitignore
# includes/functions.php (Original line commented out)
function isSNMPable($device)
{
global $config;
$pos = snmp_check($device);
if ($pos === true) {
return true;
} else {
#$pos = snmp_get($device, "sysObjectID.0", "-Oqv", "SNMPv2-MIB");
$pos = snmp_get($device, "sysDescr.0", "-Oqv", "SNMPv2-MIB");
if ($pos === '' || $pos === false) {
return false;
} else {
return true;
}
}
}
# includes/definitions/vrp.yaml
os: vrp
group: vrp
text: 'Huawei VRP'
type: network
icon: huawei
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
mib_dir:
- huawei
discovery:
- sysDescr:
- VRP (R) Software
- VRP Software Version
- Software Version VRP
- Versatile Routing Platform Software
