napalm-automation-community / napalm-hp-procurve

HP ProCurve Driver for NAPALM automation frontend
Apache License 2.0
11 stars 11 forks source link

get_lldp_neighbors #2

Open msiegy opened 4 years ago

msiegy commented 4 years ago

get_lldp_neighbors() and get_lldp_neighbors_detail() fails on JL070A HPE 2530-8-poe running YB.16.08.0001 with KeyError: ChassisId... immediate issue looks like truncation occurs and SNMP is attempted but ChassisId is not a valid key in the key_mib_table. Attempts to add {'ChassisId': 'LldpChassisId'} to the dict did not help.

driver = get_network_driver('procurve')

device = driver('192.168.1.60', '', 'manager', optional_args={'ssh_config_file': '~/.ssh/config', 'port': 22})
device.open()
vals = device.get_lldp_neighbors_detail()

device.close()
print(json.dumps(vals, sort_keys=True,
                 indent=4, separators=(',', ': ')))
Grabbing LLDP RESULTS

opened Device connection
Traceback (most recent call last):
  File "hpcollector.py", line 14, in <module>
    vals = device.get_lldp_neighbors()
  File "C:\code\nac-discovery\venv\lib\site-packages\napalm_procurve\procurve.py", line 305, in get_lldp_neighbors
    remote_port, device_id = self._get_lldp_neighbors_detail(
  File "C:\code\nac-discovery\venv\lib\site-packages\napalm_procurve\procurve.py", line 372, in _get_lldp_neighbors_detail
    tmp_lldp_details = self._lldp_detail_parser(interface)
  File "C:\code\nac-discovery\venv\lib\site-packages\napalm_procurve\procurve.py", line 411, in _lldp_detail_parser
    '{}.0.{}.1'.format(key_mib_table[key], ifs[interface]))
KeyError: 'ChassisId'
ixs commented 4 years ago

Hi @msiegy, thanks for your report. I missed it somehow, sorry for that. Now I'm getting notifications from this repo too.

Could you please give me the full output of show lldp info remote-device on your device? That can help me a) build a test for this use case to prevent regression and b) fix the problem in the first place.

Thanks a lot.

ixs commented 4 years ago

@msiegy Hi Matt,

can you get me the output of show lldp info remote-device please? That helps understanding what is going on.

thanks.

thefathacker commented 3 years ago

@ixs I have been looking at his issue, I have also been having this issue as well. I am using a 5406zl2 Switch

Output of remote-device detailed

` LLDP Remote Device Information Detail

Local Port : B5 ChassisType : local ChassisId : 00000000-0000-0E00-000... PortType : mac-address PortId : a0 0a f0 00 0e b0 SysName : System Descr : ProLiant DL360 Gen10 PortDescr : PCI-E Slot 1, Port 1 Pvid :

System Capabilities Supported : System Capabilities Enabled :

Remote Management Address Type : ipv4 Address : XXX.XXX.XXX.XXX Type : all802 Address : a0 0a f0 00 0e b0 `

Appears the OID is .1.3.6.1.4.1.9.9.23.1.2.1.1.6.37.1 = STRING: "00000000-0000-0E00-0000-000000000000"

thefathacker commented 3 years ago

Works after adding "ChassisId": "lldpRemChassisId" to key_mib_table