towerops/lib/snmpkit/snmp_lib
Graham McIntire a8e43b38d6 feat: implement batched SNMP GET for multi-OID requests (#183)
Replace sequential multi-GET with true batched SNMP GET support.
Previously, Client.get_multiple/2 sent N individual SNMP GET PDUs
for N OIDs. Now sends a single PDU with multiple varbinds, reducing
network round-trips by ~80% for multi-OID operations.

Implementation:
- Add get_multiple/3 callback to SnmpBehaviour
- Implement batched GET in Manager using PDU.build_get_request_multi/2
- Update Client.get_multiple/2 to use batched GET with sequential fallback
- Return map format %{oid => {type, value}} for batched results
- Convert to ordered list for backward compatibility
- Handle SNMP exceptions (noSuchObject, noSuchInstance) in result map

Testing:
- Update all test mocks to use get_multiple expectations
- Add individual get stubs for categorize_device_speed and optional fields
- 2249/2251 tests passing (99.87%)

This addresses F1 from LibreNMS feature parity analysis:
"Replace sequential multi-get with batched GET support."

Impact:
- Discovery system info (6 OIDs): 1 SNMP request instead of 6
- Storage polling (3 OIDs/entry): 1 request per entry instead of 3
- Network round-trips reduced by ~80% for all get_multiple operations

Reviewed-on: graham/towerops-web#183
2026-03-26 16:37:34 -05:00
..
mib chore: remove sobelow dependency 2026-03-12 16:03:08 -05:00
pdu fix/security-and-quality-issues (#136) 2026-03-24 08:06:29 -05:00
security fix/security-and-quality-issues (#136) 2026-03-24 08:06:29 -05:00
asn1.ex credo fixes 2026-01-23 16:49:02 -06:00
cache.ex chore: remove sobelow dependency 2026-03-12 16:03:08 -05:00
config.ex Fix Mix.env() runtime crash in releases 2026-02-15 17:16:48 -06:00
dashboard.ex nif ci fixes and dialyzer fixes 2026-01-30 12:38:50 -06:00
error.ex Rewrite polling_offset, changelog_parser, and user_agent_parser in Gleam (#103) 2026-03-21 10:11:06 -05:00
error_handler.ex nif ci fixes and dialyzer fixes 2026-01-30 12:38:50 -06:00
host_parser.ex credo fixes 2026-01-27 09:12:22 -06:00
manager.ex feat: implement batched SNMP GET for multi-OID requests (#183) 2026-03-26 16:37:34 -05:00
mib.ex bring in snmpkit 2026-01-23 12:52:17 -06:00
monitor.ex credo fixes 2026-01-23 16:49:02 -06:00
oid.ex Rewrite polling_offset, changelog_parser, and user_agent_parser in Gleam (#103) 2026-03-21 10:11:06 -05:00
pdu.ex nif ci fixes and dialyzer fixes 2026-01-30 12:38:50 -06:00
pool.ex credo fixes 2026-01-23 16:49:02 -06:00
security.ex credo improvements 2026-01-23 13:40:49 -06:00
transport.ex snmpkit overhaul and etcd 2026-01-23 16:23:57 -06:00
types.ex Rewrite polling_offset, changelog_parser, and user_agent_parser in Gleam (#103) 2026-03-21 10:11:06 -05:00
utils.ex Rewrite polling_offset, changelog_parser, and user_agent_parser in Gleam (#103) 2026-03-21 10:11:06 -05:00
walker.ex snmpkit overhaul and etcd 2026-01-23 16:23:57 -06:00