ruby-snmp icon indicating copy to clipboard operation
ruby-snmp copied to clipboard

Add support for walk with GETBULK

Open nward opened this issue 9 years ago • 1 comments

Walks based on GETBULK are very helpful for high latency links, and are often nicer on the agent CPU, depending on the exact design of course.

This PR implements get_bulk, which behaves very similarly to walk, with an extra max_rows option.

nward avatar Jan 24 '16 05:01 nward

Thanks for the pull request. Many people have asked for this feature in the past. It's especially nice to see some tests for the code change. Most people don't bother to provide tests.

I would like to see some changes before I can accept this change:

  • Squash the four commits into one so that the tests and the code are in the same commit.
  • The comment for "next if resp_vb.nil?" doesn't fill me with confidence. If something is happening "for some reason" we should know what the reason is before making the change.
  • Using ArgumentError as a termination condition seems wrong to me. Exceptions should only happen in exceptional conditions. Is there a different test you could use?

hallidave avatar Jan 24 '16 13:01 hallidave