A comprehensive Python SNMP library supporting v1/v2c/v3 with authentication and privacy protocols
84
A Python utility that loads and queries SNMP MIB (Management Information Base) modules to resolve symbolic names to OIDs and vice versa.
@generates
class MIBManager:
"""
Manages loading and querying of SNMP MIB modules.
"""
def __init__(self):
"""
Initializes the MIB manager.
"""
pass
def add_mib_source(self, directory: str) -> None:
"""
Adds a directory as a source for loading MIB modules.
Args:
directory: Path to the directory containing MIB files
"""
pass
def load_mib(self, module_name: str) -> None:
"""
Loads a specific MIB module by name.
Args:
module_name: Name of the MIB module to load (e.g., "SNMPv2-MIB")
Raises:
Exception: If the module cannot be found or loaded
"""
pass
def name_to_oid(self, name: str) -> str:
"""
Resolves a symbolic MIB object name to its numeric OID.
Args:
name: Symbolic name, optionally with module prefix (e.g., "sysDescr" or "SNMPv2-MIB::sysDescr")
Returns:
The numeric OID as a string (e.g., "1.3.6.1.2.1.1.1")
Raises:
Exception: If the name cannot be resolved
"""
pass
def oid_to_name(self, oid: str) -> tuple[str, str]:
"""
Resolves a numeric OID to its symbolic MIB object name.
Args:
oid: Numeric OID string (e.g., "1.3.6.1.2.1.1.1")
Returns:
A tuple of (module_name, symbol_name) (e.g., ("SNMPv2-MIB", "sysDescr"))
Raises:
Exception: If the OID cannot be resolved
"""
passProvides SNMP protocol support and MIB management capabilities.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-pysnmpevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10