snmptools
Unsafe Rust functions, based directly on net-snmp library for those, which are not Rust-native yet.
Methods:
- Converts SNMP OIDs to MIB names and vice-versa
Required crate features:
-
static (default) - compiles the binary with libnetsnmp.so dep or compile static lib inside (a bit faster)
-
dynamic - loads libnetsnmp.so or libnetsnmp.dylib dynamically (more cross-platform, not support windows system)
Example
Prepare the system
# Linux
apt-get install libsnmp-dev snmp-mibs-downloader
# MacOS
brew install net-snmp
use ;
init.unwrap;
let snmp_oid = from.unwrap;
let name = get_name.unwrap;
assert_eq!;
let snmp_oid2 = get_oid.unwrap;
assert_eq!;