RUST-SNMP
Dependency-free basic SNMPv2 client in Rust.
Suppports:
- GET
- GETNEXT
- GETBULK
- Basic SNMPv2 types
- Synchronous requests
- UDP transport
Currently does not support:
- SNMPv1
- SNMPv3
- MIBs
- Async requests
- Transports other than UDP
TODO
- Async requests
- Walking function
- Additional ObjectIdentifier utility methods
- Decouple PDU building/parsing from socket handling
- SNMPv3 (would require an external dependency)
Examples
GET NEXT
use Duration;
use ;
let sys_descr_oid = ;
let agent_addr = "198.51.100.123:161";
let community = b"f00b4r";
let timeout = from_secs;
let mut sess = new.unwrap;
let mut response = sess.getnext.unwrap;
if let Some = response.varbinds.next
GET BULK
use Duration;
use SyncSession;
let system_oid = ;
let agent_addr = "[2001:db8:f00:b413::abc]:161";
let community = b"f00b4r";
let timeout = from_secs;
let non_repeaters = 0;
let max_repetitions = 7; // number of items in "system" OID
let mut sess = new.unwrap;
let response = sess.getbulk.unwrap;
for in response.varbinds