Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[snmp | lldp] table is no present in SNMP facts #6737

Closed
vadymhlushko-mlnx opened this issue Jan 26, 2021 · 10 comments
Closed

[snmp | lldp] table is no present in SNMP facts #6737

vadymhlushko-mlnx opened this issue Jan 26, 2021 · 10 comments
Assignees

Comments

@vadymhlushko-mlnx
Copy link
Contributor

Description

Steps to reproduce the issue:

  1. Run the snmp/test_snmp_lldp.py

Describe the results you received:

        # Check if lldpLocManAddrTable is present
        for k in ['lldpLocManAddrLen', \
                   'lldpLocManAddrIfSubtype', \
                   'lldpLocManAddrIfId', \
                   'lldpLocManAddrOID']:
>           assert snmp_facts['snmp_lldp'][k]
E           KeyError: 'lldpLocManAddrLen'

snmp/test_snmp_lldp.py:56: KeyError

Describe the results you expected:

The test snmp/test_snmp_lldp.py should pass

Additional information you deem important:

**Output of `show version`:**
root@r-tigon-04:/home/admin# show version

SONiC Software Version: SONiC.201911.62-01871c46
Distribution: Debian 9.13
Kernel: 4.9.0-11-2-amd64
Build commit: 01871c46
Build date: Sun Jan 24 11:21:05 UTC 2021
Built by: sw-r2d2-bot@r-build-sonic-ci02

Platform: x86_64-mlnx_msn4600c-r0
HwSKU: ACS-MSN4600C
ASIC: mellanox
Serial Number: MT2017X29667
Uptime: 08:44:45 up 30 min,  1 user,  load average: 1.17, 1.42, 1.29

Docker images:
REPOSITORY                    TAG                  IMAGE ID            SIZE
docker-syncd-mlnx             201911.62-01871c46   23300e55e92e        399MB
docker-syncd-mlnx             latest               23300e55e92e        399MB
docker-sonic-telemetry        201911.62-01871c46   7390b0f20ba1        353MB
docker-sonic-telemetry        latest               7390b0f20ba1        353MB
docker-router-advertiser      201911.62-01871c46   054822d074e8        290MB
docker-router-advertiser      latest               054822d074e8        290MB
docker-platform-monitor       201911.62-01871c46   9d365eac9ed3        666MB
docker-platform-monitor       latest               9d365eac9ed3        666MB
docker-fpm-frr                201911.62-01871c46   3e213e60e5fe        335MB
docker-fpm-frr                latest               3e213e60e5fe        335MB
docker-teamd                  201911.62-01871c46   18b2fae1c452        315MB
docker-teamd                  latest               18b2fae1c452        315MB
docker-lldp-sv2               201911.62-01871c46   d194a1fc3734        312MB
docker-lldp-sv2               latest               d194a1fc3734        312MB
docker-dhcp-relay             201911.62-01871c46   91e5109501d8        300MB
docker-dhcp-relay             latest               91e5109501d8        300MB
docker-database               201911.62-01871c46   606201313cb2        290MB
docker-database               latest               606201313cb2        290MB
docker-snmp-sv2               201911.62-01871c46   a728ad0a214b        351MB
docker-snmp-sv2               latest               a728ad0a214b        351MB
docker-orchagent              201911.62-01871c46   e9b579c5380c        333MB
docker-orchagent              latest               e9b579c5380c        333MB
docker-sflow                  201911.62-01871c46   1b594cf0a595        315MB
docker-sflow                  latest               1b594cf0a595        315MB
docker-nat                    201911.62-01871c46   72705bb65c59        317MB
docker-nat                    latest               72705bb65c59        317MB
docker-sonic-mgmt-framework   201911.62-01871c46   48bcd90c9b33        430MB
docker-sonic-mgmt-framework   latest               48bcd90c9b33        430MB
@vadymhlushko-mlnx
Copy link
Contributor Author

vadymhlushko-mlnx commented Jan 26, 2021

show techsupport
sonic_dump_r-tigon-04_20210126_083642.tar.gz

@liat-grozovik
Copy link
Collaborator

@yxieca can you please review ? this is seen on 201911 as well

@yxieca
Copy link
Contributor

yxieca commented Feb 4, 2021

@vadymhlushko-mlnx from the dump, I don't see any lldp neighbor other than from eth0. Is this expected?

Can you paste the output of lldpshow from sonic?

To further analyzer the issue, I also need you to run a test with instrumented code:

this line: https://github.com/Azure/sonic-mgmt/blob/master/tests/snmp/test_snmp_lldp.py#L39 will not show up in output because pytest muted it. But if you could change it to

import logging
import json
logging.warning(json.dumps(snmp_facts, indent=4))

and send me the contents of snmp_facts, that would be really helpful.

@vadymhlushko-mlnx
Copy link
Contributor Author

@yxieca

$ lldpshow command output:

root@r-tigon-04:/home/admin# lldpshow
Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort    RemoteDevice             RemotePortID    Capability    RemotePortDescr
-----------  -----------------------  --------------  ------------  -----------------
Ethernet128  ARISTA01T1               Ethernet1       BR
Ethernet130  ARISTA02T1               Ethernet1       BR
Ethernet136  ARISTA03T1               Ethernet1       BR
Ethernet138  ARISTA04T1               Ethernet1       BR
eth0         MTR-F-1-S-LAB-R3-9-SW01  2               B             2
--------------------------------------------------
Total entries displayed:  5

Output of snmp_facts var:
snmp_lldp_output.txt

@yxieca
Copy link
Contributor

yxieca commented Feb 9, 2021

These 4 entries should have been populated here: https://github.com/Azure/sonic-snmpagent/blob/3885f193be05099659808092d22c5f69407cdda4/src/sonic_ax_impl/mibs/ieee802_1ab.py#L710

They are all local management information. Missing them is an image issue.

@vadymhlushko-mlnx
Copy link
Contributor Author

These 4 entries should have been populated here: https://github.com/Azure/sonic-snmpagent/blob/3885f193be05099659808092d22c5f69407cdda4/src/sonic_ax_impl/mibs/ieee802_1ab.py#L710

They are all local management information. Missing them is an image issue.

Okay, so, how to fix it?

@yxieca
Copy link
Contributor

yxieca commented Feb 9, 2021

Let's move this issue to buildimage and have it triaged there.

@yxieca yxieca transferred this issue from sonic-net/sonic-mgmt Feb 9, 2021
@abdosi
Copy link
Contributor

abdosi commented Feb 9, 2021

There are two issues here:

First the LLDP docker when setting the command "configure system ip management pattern" uses MGMT_INTERFACE.keys() which can be any order of v4 and v6 Management IP .

Second SNMP currently only handles v4 Management Address
https://github.com/Azure/sonicsnmpagent/blob/3885f193be05099659808092d22c5f69407cdda4/src/sonic_ax_impl/mibs/ieee802_1ab.py#L323

We are looking into fixing both so that we are consistent in assigning IP Address and SNMP should be able to handle v6 also.

@abdosi
Copy link
Contributor

abdosi commented Feb 11, 2021

cherry-pick #5699 to 201911. This should fix this issue.
@vadymhlushko-mlnx can you re-verify and confirm ?

@vadymhlushko-mlnx
Copy link
Contributor Author

cherry-pick #5699 to 201911. This should fix this issue.
@vadymhlushko-mlnx can you re-verify and confirm ?

The fix is working, the test - PASSED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants