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

[BUG] ipdevpoll no longer works with SNMPv1 #2779

Closed
lunkwill42 opened this issue Dec 1, 2023 · 2 comments · Fixed by #2780
Closed

[BUG] ipdevpoll no longer works with SNMPv1 #2779

lunkwill42 opened this issue Dec 1, 2023 · 2 comments · Fixed by #2780
Assignees
Labels

Comments

@lunkwill42
Copy link
Member

Describe the bug

After a few user reports, including #2772, that seemed to indicate data was missing for devices that only support SNMPv1, we had to do a thorough inspection, and can confirm the following:

  • SNMPv1 profile connectivity checks from SeedDB work just fine (using the synchronous SNMP library)
  • SNMPv1 communication from ipdevpoll, naventity and navoidverify does not work.

To Reproduce

Steps to reproduce the behavior:

  1. Add a device X that supports SNMPv1 to NAV using SeedDB
  2. Attach an SNMPv1 profile to X, and double-check connectivity with the connectivity check button.
  3. Open a terminal on your NAV server and run the command ipdevpoll -J snmpcheck -n X (where X is your device)
  4. See ipdevpoll reporting the device as being SNMP-unreachable.

Expected behavior

SNMPv1 communication should work.

Environment (please complete the following information):

  • NAV version installed: 5.8.2
@lunkwill42 lunkwill42 added the bug label Dec 1, 2023
@lunkwill42 lunkwill42 self-assigned this Dec 1, 2023
@lunkwill42
Copy link
Member Author

Packet inspection reveals that even though a device is configured with an SNMPv1 profile, ipdevpoll, naventity and navoidverify will send SNMPv2c packets to it.

Furthermore, this seems to happen even when the parameters of the generated AgentProxy instance are correct (i.e. snmpVersion='1').

Finally, it turns out the issue is with how AgentProxy works internally in the pynetsnmp library. The snmpVersion argument is actually expected to be a string that is prefixed with the letter v, as in v1, v2c or v3. The AgentProxy uses a dict to map these strings to an internal Net-SNMP value for SNMP version, and if the string doesn't match any of the known version strings, the AgentProxy silently defaults to v2c, leaving the user none the wiser.

@lunkwill42
Copy link
Member Author

Fixed by #2780

@lunkwill42 lunkwill42 linked a pull request Dec 4, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant