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

Unable to get OID for some nodes #34

Closed
Hipska opened this issue Jan 28, 2022 · 5 comments
Closed

Unable to get OID for some nodes #34

Hipska opened this issue Jan 28, 2022 · 5 comments

Comments

@Hipska
Copy link

Hipska commented Jan 28, 2022

Given the following files comverse-comone-mib.my and comverse-textual-notation.my

When doing

func main() {
	gosmi.Init()
	gosmi.SetPath("../../mibs")
	module, _ := gosmi.LoadModule("comverse-comone-mib.my")
	m, _ := gosmi.GetModule(module)
	trapNodes := m.GetNodes(types.NodeNotification)
	for _, node := range trapNodes {
		log.Printf("Trap %s::%s [%s]\n", module, node.Name, node.Oid)
	}
}

I'm getting this result:

2022/01/28 17:04:55 Trap COMVERSE-COMONE::upAlarmListRebuild []
2022/01/28 17:04:55 Trap COMVERSE-COMONE::upAlarmNew []
2022/01/28 17:04:55 Trap COMVERSE-COMONE::upAlarmChange []
2022/01/28 17:04:55 Trap COMVERSE-COMONE::upAlarmClear []

It's strange gosmi is able to find the nodes, but doesn't have the associated OID with them..

@sleepinggenius2
Copy link
Owner

Going up the OID tree for those notifications, I see that application is being imported from the COMVERSE-SNMP-OPEN-INTERFACE module. You will need to either explicitly load that module or make sure that a file with that name and optional .my, .mib, .mi2, or .txt extension is available in your search path.

@Hipska
Copy link
Author

Hipska commented Jan 28, 2022

Yeah, that’s the other file. But would the nodes and names be able to be loaded if the other one isn’t?

@sleepinggenius2
Copy link
Owner

I only see where you're loading the one file and the name of the other file doesn't match the module name, so it won't be autoloaded. In the current library version, you would get exactly what you're seeing if an import cannot be satisfied. Starting in the next release, building the module will return an error in that case.

@Hipska
Copy link
Author

Hipska commented Jan 31, 2022

Would be nice indeed if the methods return meaningful errors. Sadly it just prints to log or even stdout in some cases..

But thanks for the pointers, I will have a look..

@Hipska
Copy link
Author

Hipska commented Jan 31, 2022

Closing as the OID gets filled when loading the other MIB first..

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

No branches or pull requests

2 participants