haxtibal / netsnmptable

A Python C Extension package to query SNMP tables and table subsets, complementing the original Net-SNMP Python Bindings.
Other
7 stars 0 forks source link

Getting exactly one row by giving the full index to Table.get_entries(iid) doesn't work #4

Closed haxtibal closed 7 years ago

haxtibal commented 7 years ago

The "problem" is that getnext/getbulk always get the NEXT OID to the requested one, but not the exact match. To work around it, we could do it like [Perl Net-SNMP get_entries](http://search.cpan.org/~dtown/Net-SNMP-v6.0.1/lib/Net/SNMP.pm#get_entries()_-_retrieve_table_entries_from_the_remote_agent): "To insure that the -startindex is included, the last sub-identifier in the index is decremented by one. If the last sub-identifier has a value of zero, the sub-identifier is removed from the index."