gosmi icon indicating copy to clipboard operation
gosmi copied to clipboard

smi.GetNode returns Kind: NodeScalar instead of NodeColumn for a table's subtree

Open metalgrid opened this issue 3 years ago • 2 comments

I'm parsing a MIB for a networking device and the table columns are reporting back as Kind: Scalar instead of Column. I'm not sure if the MIB is bad, or I am misusing the library, so any input is greatly appreciated.

Here's some relevant information about my setup: Go version: 1.16.3 gosmi version: 0.4.3

Here's a gist of how I'm getting the nodes: https://gist.github.com/Metalgrid/3e9f95d2ae19009075db9a10de20ae5d

and the MIB files in question (it has a bunch of imports so I've included all of them) mibs.zip

Just to clarify, everything works properly if I look at a standard table, e.g. ifXTable works properly, but the one that I'm interested in tmnxSubMgmtGpIfStatsTable returns all Scalar values.

P.S. Thank you for the amazing library! :)

metalgrid avatar Jul 12 '21 12:07 metalgrid

After a lot of scratching my head, I have finally concluded that the issue is with the MIB itself (or one of its dependencies). I believe that I've encountered this with Nokia MIBs myself. There is a type defined somewhere that is trying to refine an existing textual convention, which is invalid (see #16 for more context), and thus the MIB files are not loading fully. I don't remember at the moment why this fails silently and doesn't error, so I will have to look into that.

sleepinggenius2 avatar Jul 13 '21 23:07 sleepinggenius2

Thanks for the confirmation. I suspected the MIB files as well, but wasn't sure if I'm not missing something because inspecting them with a recent version of SnmpB detects Columns properly, so I thought I'm missing some compatibility mode flag that needs to be enabled in gosmi.

metalgrid avatar Jul 14 '21 08:07 metalgrid