Skip to content
forked from hh-h/aiosnmp

aiosnmp is an asynchronous SNMP client and trap server for use with asyncio.

License

Notifications You must be signed in to change notification settings

stsojithomas/aiosnmp

 
 

Repository files navigation

aiosnmp

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

Documentation

https://aiosnmp.readthedocs.io/en/latest/api.html

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

About

aiosnmp is an asynchronous SNMP client and trap server for use with asyncio.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 80.3%
  • Rust 19.7%