sleepinggenius2/gosmi

testing the sample main.go file under cmd/smi example but facing Null oid error

Closed this issue · 3 comments

When we try to test out the example go code to load a module from mib and inspect the nodes, we only null being shown as the oid for the nodes. Tried with sample mibs in this repo as well as some standard mibs. Can you point if there is any issue in the way the go code is executed ?

go run main.go -d -m FIZBIN-MIB -p .
Loaded module FIZBIN-MIB
Search path: /home/cloud-user/kaushik/workspace/gosmi
Loaded modules:
()
FIZBIN-MIB (/home/cloud-user/kaushik/workspace/gosmi/FIZBIN-MIB.mib)
{"Module":{"ContactInfo":"Marshall T. Rose\n\t Postal: Dover Beach Consulting, Inc.\n\t 420 Whisman Court\n\t Mountain View, CA 94043-2186\n\t US\n\t Tel: +1 415 968 1052\n\t Fax: +1 415 968 2510\n\t E-mail: mrose@dbc.mtview.ca.us","Description":"The MIB module for entities implementing the xxxx\n\t protocol.","Language":"SMIv2","Name":"FIZBIN-MIB","Organization":"IETF SNMPv2 Working Group","Path":"/home/cloud-user/kaushik/workspace/gosmi/FIZBIN-MIB.mib","Reference":""},"Nodes":[{"Access":"Unknown","Decl":"ValueAssignment","Description":"","Kind":"Node","Name":"entityMIBTrapPrefix","Oid":null,"OidLen":0,"Status":"Unknown","Type":null,"SmiType":null},{"Access":"Unknown","Decl":"NotificationType","Description":"An entConfigChange trap is sent when the value of\nentLastChangeTime changes. It can be utilized by an NMS to\ntrigger logical/physical entity table maintenance polls.\nAn agent must not generate more than one entConfigChange\n'trap-event' in a five second period, where a 'trap-event'\nis the transmission of a single trap PDU to a list of\ntrap destinations. If additional configuration changes\noccur within the five second 'throttling' period, then\nthese trap-events should be suppressed by the agent. An\nNMS should periodically check the value of\nentLastChangeTime to detect any missed entConfigChange\ntrap-events, e.g. due to throttling or transmission loss.","Kind":"Notification","Name":"entConfigChange","Oid":null,"OidLen":0,"Status":"Current","Type":null,"SmiType":null}],"Types":[{"BaseType":"OctetString","Decl":"TextualConvention","Description":"Represents media- or physical-level addresses.","Enum":null,"Format":"1x:","Name":"PhysAddress","Ranges":[],"Reference":"","Status":"Current","Units":""}]}[root@vm-10-75-112-164 gosmi]#
[root@vm-10-75-112-164 gosmi]#
[root@vm-10-75-112-164 gosmi]#

-p -> pointing to directory where the mib file is placed
-m -> FIZBIN-MIB is the module name of the sample mib present in this repo.

why is the oid is null and length shown as 0 ?

@sleepinggenius2 , can you support please ?

The referenced MIB imports SNMPv2-SMI, but I do not see that it is being loaded. Please make sure that it is directly loaded first or an appropriately named file is present in the search path to be autoloaded.

Thank you @sleepinggenius2 .
I was able to load the OIDs after keeping those imported module named files in the same path.