-
Notifications
You must be signed in to change notification settings - Fork 37
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
gosmi Load modules not loading mib files properly and giving oid's as blank #41
Comments
Tried Parsing few mib's from internet and same issue facing there also. |
I don't have a copy of the referenced MIB, but the most common reason for this is missing dependencies. You need to make sure that every MIB that is being imported is either manually loaded or in the search path to be auto-loaded. Otherwise, you end up with an isolated subtree and no path to it from the root. |
Thank you for reaching out so quickly. I wont be able to share the mib's which I am using , but could you please provide few valid mib's which you used during testing gosmi, so that I can confirm the code is working properly with valid mib's. It would be a great help. |
@sleepinggenius2 we do have the same issue in Telegraf (influxdata/telegraf#10446) even though we are explicitly import all required MIB files. I prepared some runnable code showing the issue. It turns out that the loading order of the files is important if we cannot rely on auto-loading due to the naming differences. So if you load the files in the import-hierarchy order everything works, but if a user specifies a bunch of files in arbitrary order (e.g. by specifying a directory) things break... |
I have been trying to use gosmi for parsing mib's in my code. I have few mib's with me from which 2 mib's are parsing properly and giving proper parsed modules with all the data. but there are few mib's which are getting loaded without any error but when I try to print the nodes from loded module, i see oid's are coming as blank. it is a valid mib but still failing to get parsed in gosmi.
below is the code as well as output :
`package main
import (
"fmt"
"os"
"path/filepath"
)
func main() {
}
`
output for a successfully parsed mib:
Loaded modules: <well-known> TRIMBLE-MIB /root/testgosmi/mibs/TRIMBLE-MIB.mib trimble 1.3.6.1.4.1.46285 trimbleTiming 1.3.6.1.4.1.46285.1 trimbleTBlt 1.3.6.1.4.1.46285.1.1
output for mib which is giving error:
`TRAP-MIB /root/dummytrap/mibs/test.mib
Traps
MIBNotifObjects
TrapTimeStamp
TrapSeverity
TrapFunctionalArea
`
if you see in above output only node names are getting printed and oid's are coming as blank. so I want able to use GetNodeByOID function in order to fetch node data from above parsed mib.
It would be helpful to know if there is anything i am doing wrong. I tried to parse the same mib using Parser and it works for both mib files but as it dosent have GetNodeByOID i wanted to continue with smi parser.
The text was updated successfully, but these errors were encountered: