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-8/

Secure SNMP Monitor

A network monitoring utility that retrieves device metrics using SNMPv3 with encrypted communication.

Capabilities

Secure device monitoring

The monitor connects to network devices using SNMPv3 with authentication and encryption to retrieve system information securely.

  • Retrieves the system description (sysDescr.0 OID: 1.3.6.1.2.1.1.1.0) from a device at 127.0.0.1:1161 using SNMPv3 with username "testuser", SHA authentication with passphrase "authkey12345", and AES encryption with privacy passphrase "privkey12345" @test
  • Raises an exception when authentication credentials are incorrect @test
  • Retrieves multiple OIDs (sysDescr.0 and sysUpTime.0 OID: 1.3.6.1.2.1.1.3.0) in a single operation from 127.0.0.1:1161 using the same secure configuration @test

Implementation

@generates

API

def get_snmp_data(host: str, port: int, username: str, auth_key: str, priv_key: str, oid: str) -> str:
    """
    Retrieves SNMP data from a device using SNMPv3 with authentication and encryption.

    Args:
        host: Target device IP address
        port: SNMP port number
        username: SNMPv3 username
        auth_key: Authentication passphrase (SHA)
        priv_key: Privacy passphrase (AES encryption)
        oid: Object identifier to query

    Returns:
        The value retrieved from the specified OID as a string

    Raises:
        Exception: If authentication fails or connection cannot be established
    """
    pass

def get_multiple_snmp_data(host: str, port: int, username: str, auth_key: str, priv_key: str, oids: list[str]) -> dict[str, str]:
    """
    Retrieves multiple SNMP data points from a device using SNMPv3 with authentication and encryption.

    Args:
        host: Target device IP address
        port: SNMP port number
        username: SNMPv3 username
        auth_key: Authentication passphrase (SHA)
        priv_key: Privacy passphrase (AES encryption)
        oids: List of object identifiers to query

    Returns:
        Dictionary mapping OIDs to their retrieved values as strings

    Raises:
        Exception: If authentication fails or connection cannot be established
    """
    pass

Dependencies { .dependencies }

pysnmp { .dependency }

Provides SNMPv3 protocol support with authentication and encryption capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/pypi-pysnmp

tile.json