CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pysnmp

A comprehensive Python SNMP library supporting v1/v2c/v3 with authentication and privacy protocols

84

0.94x
Overview
Eval results
Files

task.mdevals/scenario-6/

MIB Module Manager

A Python utility that loads and queries SNMP MIB (Management Information Base) modules to resolve symbolic names to OIDs and vice versa.

Capabilities

Load MIB modules from directories

  • Loads a specific MIB module by name from a directory containing MIB files @test
  • Loads multiple MIB modules from the same directory @test

Resolve symbolic names to OIDs

  • Resolves a simple symbolic MIB object name (like "sysDescr") to its numeric OID @test
  • Resolves a compound symbolic name with module prefix (like "SNMPv2-MIB::sysDescr") to its OID @test

Resolve OIDs to symbolic names

  • Resolves a numeric OID string to its symbolic MIB object name @test
  • Returns the module name along with the symbolic name when resolving an OID @test

Handle MIB loading errors

  • Raises an appropriate error when attempting to load a non-existent MIB module @test

Implementation

@generates

API

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
        """
        pass

Dependencies { .dependencies }

pysnmp { .dependency }

Provides SNMP protocol support and MIB management capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-pysnmp

tile.json