clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
212 stars 72 forks source link

Yang leaves without smiv2:oid directive are not shown well in snmpwalk #398

Closed doron2020 closed 1 year ago

doron2020 commented 1 year ago

Hello Olof, it is Doron & Stas from Siklu team

We have a problem that last item OID in a list is not properly shown in snmpwalk or it is not shown at all.

In this example (Attached) the last oid item in the list component is 1.3.6.1.2.1.47.1.1.1.1.16

When we do snmpwalk on oid 16 we get this error (No Such Object) even thou this item was filled with dada:

snmpwalk -v2c -c public 10.40.0.156 1.3.6.1.2.1.47.1.1.1.1.16 iso.3.6.1.2.1.47.1.1.1.1.16 = No Such Object available on this agent at this OID

snmpwalk on the item before it (oid 13) looks ok:

snmpwalk -v2c -c public 10.40.0.156 1.3.6.1.2.1.47.1.1.1.1.13 iso.3.6.1.2.1.47.1.1.1.1.13.1 = Hex-STRING: 4D 48 2D 42 33 36 36 2D 43 43 50 00

Now If we put the last oid item (oid 16) in comment

               //   smiv2:max-access "read-only";
               //   smiv2:oid "1.3.6.1.2.1.47.1.1.1.1.16";

This is the new result of snmpwalk for oid 13

snmpwalk -v2c -c public 10.40.0.156 1.3.6.1.2.1.47.1.1.1.1.13 iso.3.6.1.2.1.47.1.1.1.1.13.1 = Hex-STRING: 4D 48 2D 42 33 36 36 2D 43 43 50 00 iso.3.6.1.2.1.47.1.1.1.1.13.1.1 = INTEGER: 1 // an extra line is added.

Also some other items are defected as a result of commenting oid 16. For example oid 6

snmpwalk -v2c -c public 10.40.0.156 1.3.6.1.2.1.47.1.1.1.1.6 iso.3.6.1.2.1.47.1.1.1.1.6.1 = INTEGER: -1 iso.3.6.1.2.1.47.1.1.1.1.6.2 = INTEGER: 0 iso.3.6.1.2.1.47.1.1.1.1.6.3 = INTEGER: 1 iso.3.6.1.2.1.47.1.1.1.1.6.3.3 = INTEGER: 0 // extra line iso.3.6.1.2.1.47.1.1.1.1.6.4 = INTEGER: 2 iso.3.6.1.2.1.47.1.1.1.1.6.4.4 = INTEGER: 0 // extra line iso.3.6.1.2.1.47.1.1.1.1.6.5 = INTEGER: 3 iso.3.6.1.2.1.47.1.1.1.1.6.5.5 = INTEGER: 0 // extra line ..

This is the correct outoput of oid 6 when there is no comment for oid 16:

iso.3.6.1.2.1.47.1.1.1.1.6.1 = INTEGER: -1 iso.3.6.1.2.1.47.1.1.1.1.6.2 = INTEGER: 0 iso.3.6.1.2.1.47.1.1.1.1.6.3 = INTEGER: 1 iso.3.6.1.2.1.47.1.1.1.1.6.4 = INTEGER: 2 iso.3.6.1.2.1.47.1.1.1.1.6.5 = INTEGER: 3 ...

Attached the yang file

Thank you Doron & Stas

radio-bridge-tg-inventory.yang.txt

krihal commented 1 year ago

Hi,

I'll see if I can reproduce this bug as well just like #396.

Thanks, /K

krihal commented 1 year ago

Hi,

Can you share the MIB with us for this one as well? We'd like to test to convert the MIB to YANG using smidump and reproduce the error.

BR

doron2020 commented 1 year ago

I have changed the description of bug from "snmwalk for last OID in list is not shown properly" to "Yang leaves without smiv2:oid directive are not shown well in snmpwalk" since this is the actual problem. Leaves without smiv2:oid directive should be ignored in snmpwalk. We have a solution to that and will suggest a fix to clicon/clixon

olofhagsand commented 1 year ago

The PR does not work properly, there are warnings and fails in docker/CI

olofhagsand commented 1 year ago

PR merged with master, please verify and close if OK