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

bulkwalk can omit OIDs that snmpwalk does show #467

Open
jjdmol opened this issue Apr 22, 2024 · 1 comment
Open

bulkwalk can omit OIDs that snmpwalk does show #467

jjdmol opened this issue Apr 22, 2024 · 1 comment
Labels

Comments

@jjdmol
Copy link

jjdmol commented Apr 22, 2024

Gosnmp's walker does not show as many OIDs as snmpwalk does in one of our devices. For example:

~/gosnmp$ snmpwalk -c public -v 2c 10.99.250.70 1.3.6.1.4.1.5961.5.6.2.1.2
iso.3.6.1.4.1.5961.5.6.2.1.2.0 = INTEGER: 1
iso.3.6.1.4.1.5961.5.6.2.1.2.1 = INTEGER: 2
iso.3.6.1.4.1.5961.5.6.2.1.2.2 = INTEGER: 3
iso.3.6.1.4.1.5961.5.6.2.1.2.3 = INTEGER: 4
~/gosnmp$ go run examples/walkexample/main.go 10.99.250.70 1.3.6.1.4.1.5961.5.6.2.1.2
.1.3.6.1.4.1.5961.5.6.2.1.2.0 = TYPE 2: 1
.1.3.6.1.4.1.5961.5.6.2.1.2.1 = TYPE 2: 2
.1.3.6.1.4.1.5961.5.6.2.1.2.2 = TYPE 2: 3

Yet gosnmp is able to retrieve the specific instances just fine, if explicitly asked to do so:

~/gosnmp$ go run examples/walkexample/main.go 10.99.250.70 1.3.6.1.4.1.5961.5.6.2.1.2.3
.1.3.6.1.4.1.5961.5.6.2.1.2.3.0 = TYPE 2: 4

Attached is the output of the same commands with debugging enabled:

@TimRots
Copy link
Member

TimRots commented Apr 28, 2024

Thanks for reporting.

After a look at the walk code I feel that line 157 in walk.go is responsible for this issue

oid = response.Variables[len(response.Variables)-1].Name

and needs to become

oid = response.Variables[len(response.Variables)].Name

Would it be possible for you to run a quick test with above modification ? I currently don't have the means available to test extensively.

@TimRots TimRots added the bug label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants