#mib #tool #snmp

snmptools

SNMP common tools

15 releases

0.2.0 Nov 19, 2025
0.1.3 Dec 29, 2024
0.0.11 Jul 10, 2023
0.0.10 Jun 2, 2022

#4 in #mib

Download history 529/week @ 2026-02-15 370/week @ 2026-02-22 612/week @ 2026-03-01 1032/week @ 2026-03-08 809/week @ 2026-03-15 753/week @ 2026-03-22 585/week @ 2026-03-29 648/week @ 2026-04-05 532/week @ 2026-04-12 415/week @ 2026-04-19 288/week @ 2026-04-26 706/week @ 2026-05-03 600/week @ 2026-05-10 606/week @ 2026-05-17 293/week @ 2026-05-24 481/week @ 2026-05-31

2,028 downloads per month
Used in snmp2

Apache-2.0

11KB
229 lines

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 snmptools::{Oid};

snmptools::init(&snmptools::Config::new().mibs(&["./ibmConvergedPowerSystems.mib"])).unwrap();
let snmp_oid = Oid::from(&[1, 3, 6, 1, 4, 1, 2, 6, 201, 3]).unwrap();
let name = snmptools::get_name(&snmp_oid).unwrap();
assert_eq!(name, "IBM-CPS-MIB::cpsSystemSendTrap");
let snmp_oid2 = snmptools::get_oid(&name).unwrap();
assert_eq!(snmp_oid, snmp_oid2);

Dependencies

~1.6–2.4MB
~47K SLoC