Skip to main content

asyncio SNMP client

Project description

Build Status Code Coverage PyPI version License Code Style Python version

aiosnmp is an asynchronous SNMP client for use with asyncio.

Notice on 0.6.0 build

If you have some problems with 0.6.0 build, please, create an issue and downgrade to 0.5.0.
There is no difference between 0.5.0 and 0.6.0 only asn1 parser migrated to rust.

Installation

pip install aiosnmp

Notice

Only snmp v2c supported, v3 version is not supported
Oids should be like .1.3.6... or 1.3.6.... iso.3.6... is not supported

Source address (host and port) validation

By default, v2c should not validate source addr, but in this library, it is enabled by default. You can disable validation by passing validate_source_addr=False to Snmp.

Basic Usage

import asyncio
import aiosnmp

async def main():
    async with aiosnmp.Snmp(host="127.0.0.1", port=161, community="public") as snmp:
        for res in await snmp.get(".1.3.6.1.2.1.1.1.0"):
            print(res.oid, res.value)

asyncio.run(main())

more in /examples

TODO

  • snmp v3 support
  • more tests

License

aiosnmp is developed and distributed under the MIT license.

Run local tests

pip install -r requirements-dev.txt
tox

Before submitting PR

pip install -r requirements-dev.txt
tox -e format

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

aiosnmp-0.7.0.tar.gz (16.1 kB view hashes)

Uploaded source

Built Distributions

aiosnmp-0.7.0-cp310-cp310-win_amd64.whl (490.3 kB view hashes)

Uploaded cp310

aiosnmp-0.7.0-cp39-cp39-win_amd64.whl (490.5 kB view hashes)

Uploaded cp39

aiosnmp-0.7.0-cp38-cp38-win_amd64.whl (490.9 kB view hashes)

Uploaded cp38

aiosnmp-0.7.0-cp37-cp37m-win_amd64.whl (491.1 kB view hashes)

Uploaded cp37

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page