librenms / librenms

Community-based GPL-licensed network monitoring system
https://www.librenms.org
Other
3.81k stars 2.27k forks source link

Huawei S5735-series switches/Serial number missing #15056

Open jonasblomq opened 1 year ago

jonasblomq commented 1 year ago

The problem

Hi

I noticed a issue with Huawei S5735 and S6730 series switches. LibreNMS does not populate the Serial field.

Doing a snmp walk under the oid: 1.3.6.1.2.1.47.1.1.1.1.11 finds the following field on a 5735 switch:

.1.3.6.1.2.1.47.1.1.1.1.11.67108867 = STRING: “4E23XXXXX72” .1.3.6.1.2.1.47.1.1.1.1.11.67108873 = STRING: “4E23XXXXX72”

Output of ./validate.php

===========================================
Component | Version
--------- | -------
LibreNMS  | 23.5.0 (2023-05-19T18:32:19+03:00)
DB Schema | 2023_05_12_071412_devices_expand_timetaken_doubles (251)
PHP       | 8.1.8
Python    | 3.9.14
Database  | MariaDB 10.5.16-MariaDB
RRDTool   | 1.7.2
SNMP      | 5.9.1
===========================================

[OK]    Composer Version: 2.5.5
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQl and PHP time match
[OK]    Distributed Polling setting is enabled globally
[OK]    Connected to rrdcached
[FAIL]  Missing PHP extension: memcached
        [FIX]:
        Please install memcached
[OK]    Active pollers found
[OK]    Dispatcher Service is enabled
[OK]    Locks are functional
[OK]    No python wrapper pollers found
[OK]    Redis is functional
[OK]    rrdtool version ok
[OK]    Connected to rrdcached

(Note, it complains about memcached because we are using distributed pollers, with redis as the locking module)

What was the last working version of LibreNMS?

23.5.0

Device info

S5735-L48P4X-A1

Discovery output

LibreNMS Discovery
SQL[select `migration` from `migrations` order by `id` desc limit 1 [] 0.57ms] 

SQL[select count(*) as aggregate from `migrations` [] 0.45ms] 

SQL[select version() [] 0.33ms] 

===========================================
Component | Version
--------- | -------
LibreNMS  | 23.5.0 (2023-05-19T18:32:19+03:00)
DB Schema | 2023_05_12_071412_devices_expand_timetaken_doubles (251)
PHP       | 8.1.8
Python    | 3.9.14
Database  | MariaDB 10.5.16-MariaDB
RRDTool   | 1.7.2
SNMP      | 5.9.1
===========================================
DEBUG!
Updating os_def.cache  
SQL[SELECT * FROM `devices` WHERE disabled = 0 AND `device_id` = '2678' ORDER BY device_id DESC [] 1.18ms] 

SQL[select * from `devices` where `device_id` = ? limit 1 [2678] 0.68ms] 

SQL[select * from `devices_attribs` where `devices_attribs`.`device_id` = ? and `devices_attribs`.`device_id` is not null [2678] 0.38ms] 

10.109.3.54 2678 vrp [FPING] '/usr/sbin/fping' '-e' '-q' '-c' '3' '-p' '500' '-t' '500' '-O' '0' '10.109.3.54'

response: xmt/rcv/%loss = 3/3/0%, min/avg/max = 8.15/8.7/9.68  
SNMP['/usr/bin/snmpget' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' '-v3' '-l' 'authPriv' '-n' "" '-x' 'AES' '-X' 'PASSWORD' '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-OQXUte' 'udp:HOSTNAME:161' 'SNMPv2-MIB::sysObjectID.0']  
SNMPv2-MIB::sysObjectID.0 = SNMPv2-SMI::enterprises.2*0

Modules status: Global+  
OS  
Device  

#### Load disco module core ####
Attempting to initialize OS: vrp  
OS initialized: LibreNMS\OS\Vrp  
SNMP['/usr/bin/snmpget' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' '-v3' '-l' 'authPriv' '-n' "" '-x' 'AES' '-X' 'PASSWORD' '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-OQXUte' '-On' 'udp:HOSTNAME:161' 'SNMPv2-MIB::sysObjectID.0' 'SNMPv2-MIB::sysDescr.0' 'SNMPv2-MIB::sysName.0']  
.*.*.0 = .*.4.1.2*0
.*.*.0 = S5735-L48P4X-A1 
Huawei Versatile Routing Platform Software 
 VRP (R) software,Version 5.170 (S5735 V200R022C00SPC500) 
 Copyright (C) 2007 Huawei Technologies Co., Ltd.
.*.*.0 = VSA-KUS01-002-DJK13-A01-T

| S5735-L48P4X-A1 
Huawei Versatile Routing Platform Software 
 VRP (R) software,Version 5.170 (S5735 V200R022C00SPC500) 
 Copyright (C) 2007 Huawei Technologies Co., Ltd. | .1.3.6.1.4.1.2011.2.23.900 | 

OS: Huawei VRP (vrp)

Attempting to initialize OS: vrp  
OS initialized: LibreNMS\OS\Vrp  

>> Runtime for discovery module 'core': 0.0870 seconds with 15304 bytes
>> SNMP: [1/0.07s] MySQL: [0/0.00s] RRD: [0/0.00s]  
#### Unload disco module core ####

Modules status: Global+  
OS  
Device  

#### Load disco module os ####
Yaml location data:  
SNMP['/usr/bin/snmpget' '-v3' '-l' 'authPriv' '-n' "" '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-x' 'AES' '-X' 'PASSWORD' '-Oqv' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' 'udp:HOSTNAME:161' 'SNMPv2-MIB::sysLocation.0']
"<REDACTED>"  

SQL[select * from `locations` where (`location` = ?) limit 1 ["<REDACTED>"] 0.45ms] 

SNMP['/usr/bin/snmpget' '-v3' '-l' 'authPriv' '-n' "" '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-x' 'AES' '-X' 'PASSWORD' '-Ovq' '-m' 'SNMPv2-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' 'udp:HOSTNAME:161' 'sysContact.0']
R&D Beijing, Huawei Technologies Co., Ltd.  

SNMP['/usr/bin/snmpget' '-v3' '-l' 'authPriv' '-n' "" '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-x' 'AES' '-X' 'PASSWORD' '-OUQ' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' 'udp:HOSTNAME:161' 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityExtentMIB.6.5.0' 'HUAWEI-DEVICE-EXT-MIB::hwProductName.0' 'HUAWEI-MIB::hwDatacomm.183.1.25.1.5.1' 'HUAWEI-MIB::mlsr.20.1.1.1.3.0' 'HUAWEI-ENTITY-EXTENT-MIB::hwEntityBoardName.9' 'HUAWEI-DEVICE-EXT-MIB::hwDeviceEsn.0' 'ENTITY-MIB::entPhysicalSerialNum.9']
HUAWEI-ENTITY-EXTENT-MIB::hwEntitySystemModel.0 = S5735-L48P4X-A1
HUAWEI-DEVICE-EXT-MIB::hwProductName.0 = No Such Object available on this agent at this OID
HUAWEI-MIB::hwDatacomm.*.5.1 = No Such Object available on this agent at this OID
HUAWEI-MIB::mlsr.*.3.0 = No Such Object available on this agent at this OID
HUAWEI-ENTITY-EXTENT-MIB::hwEntityBoardName.9 = No Such Instance currently exists at this OID
HUAWEI-DEVICE-EXT-MIB::hwDeviceEsn.0 = No Such Object available on this agent at this OID
ENTITY-MIB::entPhysicalSerialNum.9 = No Such Instance currently exists at this OID  

Yaml OS data: {"HUAWEI-ENTITY-EXTENT-MIB::hwEntitySystemModel.0":"S5735-L48P4X-A1"} 
SNMP['/usr/bin/snmpgetnext' '-v3' '-l' 'authPriv' '-n' "" '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-x' 'AES' '-X' 'PASSWORD' '-OQv' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' 'udp:HOSTNAME:161' 'HUAWEI-SYS-MAN-MIB::hwPatchVersion']
0  

Location: <REDACTED>
Hardware: S5735-L48P4X-A1
OS Version: 5.170 (V200R022C00SPC500)
OS Features: 
Serial: 

>> Runtime for discovery module 'os': 0.6630 seconds with 412800 bytes
>> SNMP: [5/0.65s] MySQL: [1/0.00s] RRD: [0/0.00s]  
#### Unload disco module os ####

Modules status: Global+  
OS  
Device

Poller output

LibreNMS Poller
SQL[select `migration` from `migrations` order by `id` desc limit 1 [] 0.44ms] 

SQL[select count(*) as aggregate from `migrations` [] 0.41ms] 

SQL[select version() [] 0.5ms] 

===========================================
Component | Version
--------- | -------
LibreNMS  | 23.5.0 (2023-05-19T18:32:19+03:00)
DB Schema | 2023_05_12_071412_devices_expand_timetaken_doubles (251)
PHP       | 8.1.8
Python    | 3.9.14
Database  | MariaDB 10.5.16-MariaDB
RRDTool   | 1.7.2
SNMP      | 5.9.1
===========================================
DEBUG!
Updating os_def.cache  
Starting polling run:

SQL[SELECT * FROM `devices` WHERE `disabled` = 0 AND `device_id` = 2678 ORDER BY `device_id` ASC [] 0.62ms] 

SQL[select * from `devices` where `device_id` = ? limit 1 [2678] 0.48ms] 

SQL[select * from `devices_attribs` where `devices_attribs`.`device_id` = ? and `devices_attribs`.`device_id` is not null [2678] 0.39ms] 

Attempting to initialize OS: vrp  
OS initialized: LibreNMS\OS\Vrp  
Hostname:    10.109.3.54
Device ID:   2678
OS:          vrp
 (vrp)

[FPING] '/usr/sbin/fping' '-e' '-q' '-c' '3' '-p' '500' '-t' '500' '-O' '0' '10.109.3.54'

response: xmt/rcv/%loss = 3/3/0%, min/avg/max = 7.96/8.14/8.25  
SNMP['/usr/bin/snmpget' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' '-v3' '-l' 'authPriv' '-n' "" '-x' 'AES' '-X' 'PASSWORD' '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-OQXUte' 'udp:HOSTNAME:161' 'SNMPv2-MIB::sysObjectID.0']  
SNMPv2-MIB::sysObjectID.0 = SNMPv2-SMI::enterprises.2*0

SQL[insert into `device_perf` (`min`, `max`, `avg`, `xmt`, `rcv`, `loss`, `debug`, `device_id`, `timestamp`) values (?, ?, ?, ?, ?, ?, ?, ?, ?) [7.96,8.25,8.14,3,3,0,"{\"poller_name\":\"valibrenms01.tierainfra.local\"}",2678,"2023-05-23 08:36:06"] 8.64ms] 

SQL[update `devices` set `last_ping_timetaken` = ? where `device_id` = ? [8.14,2678] 8.65ms] 

SQL[select * from `device_outages` where `device_outages`.`device_id` = ? and `device_outages`.`device_id` is not null and `up_again` is null order by `going_down` desc limit 1 [2678] 0.49ms] 

Modules status: Global+  
OS  
Device  

#### Load poller module core ####
SNMP['/usr/bin/snmpget' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' '-v3' '-l' 'authPriv' '-n' "" '-x' 'AES' '-X' 'PASSWORD' '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-OQXUte' '-On' 'udp:HOSTNAME:161' 'SNMPv2-MIB::sysUpTime.0']  
.*.*.0 = 15328006

SNMP['/usr/bin/snmpget' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' '-v3' '-l' 'authPriv' '-n' "" '-x' 'AES' '-X' 'PASSWORD' '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-OQXUte' 'udp:HOSTNAME:161' 'SNMP-FRAMEWORK-MIB::snmpEngineTime.0' 'HOST-RESOURCES-MIB::hrSystemUptime.0']  
SNMP-FRAMEWORK-MIB::snmpEngineTime.0 = 153151
HOST-RESOURCES-MIB::hrSystemUptime.0 = No Such Object available on this agent at this OID

Uptime seconds: 153280

Uptime: 1 day 18 hours 34 minutes 40 seconds
SQL[update `devices` set `uptime` = ? where `device_id` = ? [153280,2678] 6.48ms] 

>> Runtime for poller module 'core': 0.1578 seconds with 118352 bytes
>> SNMP: [2/0.15s] MySQL: [1/0.06s]   
#### Unload poller module core ####

Modules status: Global-  
OS  
Device  
Module [ unix-agent ] disabled globally.

Modules status: Global+  
OS  
Device  

#### Load poller module os ####
SNMP['/usr/bin/snmpbulkwalk' '-v3' '-l' 'authPriv' '-n' "" '-a' 'SHA' '-A' 'PASSWORD' '-u' 'USER' '-x' 'AES' '-X' 'PASSWORD' '-OQUsetX' '-m' 'HUAWEI-WLAN-AP-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/huawei' 'udp:HOSTNAME:161' 'hwWlanApName']
hwWlanApName = No Such Object available on this agent at this OID  

SQL[select * from `locations` where `locations`.`id` = ? limit 1 [1365] 0.81ms] 

Location: <REDACTED>
Hardware: S5735-L48P4X-A1
OS Version: 5.170 (V200R022C00SPC500)
OS Features: 
Serial: 

>> Runtime for poller module 'os': 0.1280 seconds with 120520 bytes
>> SNMP: [0/0.00s] MySQL: [1/0.01s]   
#### Unload poller module os ####

Modules status: Global+  
OS  
Device
rudybroersma commented 7 months ago

We can add this, but you should request this under ' Device Support' and include a SNMPwalk/SNMPrec file from your device.