Skip to main content

trishul-snmp

CI Python License: MIT GitHub Stars GitHub Forks GitHub Issues

A modern SNMP runtime, manager, and simulator toolkit written in Python.

trishul-snmp (tsnmp) is a package-first SNMP runtime for manager-side use, notification handling, and narrow simulator-style responder flows. It keeps the protocol runtime independent from MIB compilation and uses compiled JSON artifacts only when symbolic enrichment is desired.

For the canonical tsnmp/tsmi split, tested version pairing, and current ecosystem status, see Ecosystem and Compatibility.

The split with trishul-smi (tsmi) is intentional:

  • tsnmp Runtime, transport, manager API, thin CLI, optional enrichment consumer
  • tsmi Parser/compiler that produces compiled JSON artifacts

The primary product is the importable Python package. The CLI is intentionally thin and secondary. It installs as both tsnmp and trishul-snmp console scripts (same command surface); usage output reflects whichever name was invoked.

Features

  • async-first Python API
  • SNMPv1 manager runtime (V1Manager; GETBULK downgrades to GETNEXT loops)
  • SNMPv2c manager runtime
  • SNMPv3 USM manager runtime (V3Manager; noAuthNoPriv, authNoPriv HMAC-MD5/SHA-1/SHA-224/SHA-256/SHA-384/SHA-512, authPriv AES-128/192/256 (Reeder) and 3DES-EDE)
  • read-only operations:
    • get
    • get_next
    • get_bulk
    • walk
    • bulkwalk
  • outbound SNMPv1 trap send (V1Notifier; enterprise/generic/specific fields)
  • outbound SNMPv2c trap and inform send
  • outbound SNMPv3 USM trap and inform send (V3Notifier; traps require UsmLocalEngine)
  • inbound SNMPv1, SNMPv2c, and SNMPv3 USM trap and inform listen (V3NotificationListener handles one configured user) with drop counters, rate-limited warnings, and on_error hooks
  • offline SNMPv1, SNMPv2c, and strict SNMPv3 USM notification decode
  • narrow read-only SNMPv2c responder / simulator
  • simulation rules for dynamic OID values (counters, gauges, uptime, timestamps)
  • bundle-backed auto-population of simulator object sets
  • in-memory MIB bundle iteration and substring search
  • JSON-safe notification event serialization
  • in-tree BER / ASN.1 / SNMPv2c + SNMPv3 wire/security codec
  • UDP transport and request dispatcher
  • optional symbolic translation and display enrichment from compiled JSON MIB artifacts
  • works with numeric OIDs and no MIB bundle loaded
  • live CLI commands cover SNMPv1, SNMPv2c, plus SNMPv3 manager, notification send, notification listen, and offline decode

Scope

Current main-branch baseline:

  • manager operations plus notification send/listen/decode
  • narrow read-only responder / simulator support
  • SNMPv1 (community), SNMPv2c, and SNMPv3 USM (noAuthNoPriv, authNoPriv HMAC-MD5/SHA-1/SHA-224/SHA-256/SHA-384/SHA-512, authPriv AES-128/192/256 Reeder and 3DES-EDE)
  • read-only operations only
  • async-first Python API first, CLI second
  • optional compiled-JSON enrichment via tsmi artifacts
  • no runtime dependency on trishul-smi

Deliberately deferred:

  • raw MIB file or raw MIB directory ingestion
  • pysnmp API compatibility shims
  • direct runtime dependency on the trishul-smi Python package
  • sync wrapper
  • DES-CBC privacy (no single-DES primitive in the cryptography backend; PrivProtocol.DES fails fast with an accurate error)
  • set
  • full agent framework
  • writable responder support
  • compiler workflows inside tsnmp

Installation

pip install trishul-snmp

For SNMPv3 privacy/authPriv support (AES-128/192/256-CFB and 3DES-EDE encryption):

pip install "trishul-snmp[v3]"

The base package covers SNMPv1, SNMPv2c, plus SNMPv3 noAuthNoPriv and authNoPriv. Install [v3] only for privacy/authPriv flows.

For local development:

pip install -e ".[dev,v3]"

Requires Python >=3.10.

Quick Start

Numeric GET with no bundle:

import asyncio

from trishul_snmp import V2cManager


async def main() -> None:
    async with V2cManager(host="10.0.0.10", community="public") as manager:
        response = await manager.get("1.3.6.1.2.1.1.3.0")
        for varbind in response.varbinds:
            print(varbind.oid_str, varbind.value_type, varbind.display_value)


asyncio.run(main())

Symbolic GET with a compiled JSON bundle:

import asyncio

from trishul_snmp import V2cManager, load_bundle

bundle = load_bundle("./IF-MIB.json")


async def main() -> None:
    async with V2cManager(
        host="10.0.0.10",
        community="public",
        bundle=bundle,
    ) as manager:
        response = await manager.get("IF-MIB::ifDescr.1")
        for varbind in response.varbinds:
            print(varbind.display_name, "=", varbind.display_value)


asyncio.run(main())

SNMPv3 USM GET:

import asyncio

from trishul_snmp import AuthProtocol, UsmUser, V3Manager

user = UsmUser(
    username="monitor",
    auth_protocol=AuthProtocol.SHA256,
    auth_key=b"authpass123",
)


async def main() -> None:
    async with V3Manager(host="10.0.0.10", user=user) as manager:
        response = await manager.get("1.3.6.1.2.1.1.3.0")
        for varbind in response.varbinds:
            print(varbind.oid_str, varbind.value_type, varbind.display_value)


asyncio.run(main())

Current CLI coverage includes SNMPv1, SNMPv2c, plus SNMPv3 get, getnext, getbulk, walk, bulkwalk, trap, inform, listen, and decode-notification via explicit --snmp-version {1,2c,3} selection. SNMPv3 listen requires explicit --local-engine-id, --local-engine-boots, and --local-engine-time. SNMPv3 decode-notification requires explicit user/auth/priv inputs.

Documentation

Repository Layout

  • trishul_snmp/ Package source
  • tests/ Test suite
  • docs/ Application and design documentation
  • docs/archive/ Archived planning and historical release notes
  • README.md Repository/GitHub landing page

Community

Canonical package docs live under docs/. GitHub/community entry points live under .github/.

Development

Checks used in this repo:

python3 -m pytest -q
python3 -m ruff check .
python3 -m ruff format --check trishul_snmp tests
python3 -m mypy

License

MIT — see LICENSE.

Metadata

Release files for trishul-snmp 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trishul-snmp 0.6.1
File Size Uploaded
trishul_snmp-0.6.1.tar.gz 227.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trishul-snmp 0.6.1
File Interpreter ABI Platform
trishul_snmp-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 314.4 kB

Release files / trishul_snmp-0.6.1.tar.gz

Download URL trishul_snmp-0.6.1.tar.gz
Size 227.0 kB
Tags Source
SHA-256 checksum
How to use checksums
305a1a39f35be3f095ea10497aa0d09512cb4778e36646da5de80408f605fa79
BLAKE2b-256 checksum
How to use checksums
00ee61c23d1efa05bf2fa2d9ce1d816b98ee73f4b1adfb238a28092db4980c9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / trishul_snmp-0.6.1-py3-none-any.whl

Download URL trishul_snmp-0.6.1-py3-none-any.whl
Size 87.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3adc1086bf06f313428cd3df9864c80ae2bde4f2db6158d93b45d48edfc9148b
BLAKE2b-256 checksum
How to use checksums
338f2de55411885061115bf228e2e86233f725fd8bf93e4fd673a3551d47358b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.2

2 release files

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page