Skip to main content

A modern SNMP runtime and manager with optional tsmi-powered MIB enrichment

Project description

trishul-snmp

CI Python License: MIT GitHub Stars GitHub Forks GitHub Issues

A modern SNMP runtime and manager written in Python.

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

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.

Features

  • async-first Python API
  • manager-only SNMPv2c runtime
  • read-only operations:
    • get
    • get_next
    • get_bulk
    • walk
    • bulkwalk
  • in-tree BER / ASN.1 / SNMPv2c wire 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

Scope

Current v0.1 baseline:

  • manager-only
  • SNMPv2c-only
  • 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
  • SNMPv1
  • SNMPv3
  • set
  • traps / listener
  • agent/responder support
  • compiler workflows inside tsnmp

Installation

pip install trishul-snmp

For local development:

pip install -e .[dev]

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())

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trishul_snmp-0.1.0.tar.gz (57.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trishul_snmp-0.1.0-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file trishul_snmp-0.1.0.tar.gz.

File metadata

  • Download URL: trishul_snmp-0.1.0.tar.gz
  • Upload date:
  • Size: 57.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trishul_snmp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cad96af1db713dddf40b82cb2659cc47842189eb335b35810a6fcc14938135e9
MD5 78ebdea1e35154c0f7ac2ce4e96444ba
BLAKE2b-256 d28e2dc701928274e0f1f8b27e9985763d092e68c0f3798d1a30c9dba7a2fa06

See more details on using hashes here.

Provenance

The following attestation bundles were made for trishul_snmp-0.1.0.tar.gz:

Publisher: release.yml on tosumitdhaka/trishul-snmp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trishul_snmp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: trishul_snmp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trishul_snmp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1dc5d91ffb687b2e178f93ee65f5f4d46313f12aa4b87a91d7223528b2b2062
MD5 9b1c7387d188d31d86b33be20155eb99
BLAKE2b-256 67dd713cef474251316f88160fff63dddba717f3c58f249e76320ced425dff89

See more details on using hashes here.

Provenance

The following attestation bundles were made for trishul_snmp-0.1.0-py3-none-any.whl:

Publisher: release.yml on tosumitdhaka/trishul-snmp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page