Package: gufo-snmp
Gufo SNMPThe accelerated Python SNMP client library.Documentation:https://docs.gufolabs.com/gufo_snmp/Source Code:https://github.com/gufolabs/gufo_snmp/Gufo SNMPis the accelerated Python SNMP client library supporting both async and synchronous mode.
It consists of a clean Python API for high-efficient BER parser
and socket IO, implemented in theRustlanguage withPyO3wrapper.The querying of the single MIB key is a simple task:fromgufo.snmpimportSnmpSessionasyncwithSnmpSession(addr="127.0.0.1",community="public")assession:r=awaitsession.get("1.3.6.1.2.1.1.3.0")And the blocking mode shares virtually the same API:fromgufo.snmp.sync_clientimportSnmpSessionwithSnmpSession(addr="127.0.0.1",community="public")assession:r=session.get("1.3.6.1.2.1.1.3.0")Multiple keys can be queried by one request too:asyncwithSnmpSession(addr="127.0.0.1",community="public")assession:r=awaitsession.get_many(["1.3.6.1.2.1.1.3.0","1.3.6.1.2.1.1.2.0"])The querying of the MIB parts is also available with GetNext request:asyncwithSnmpSession(addr="127.0.0.1",community="public")assession:asyncforoid,valueinsession.getnext("1.3.6.1.2.1.1"):...And with GetBulk request:asyncwithSnmpSession(addr="127.0.0.1",community="public")assession:asyncforoid,valueinsession.getbulk("1.3.6.1.2.1.1"):...The.fetch()method allows to choose between.getnext()and.getbulk()automatically:asyncwithSnmpSession(addr="127.0.0.1",community="public")assession:asyncforoid,valueinsession.fetch("1.3.6.1.2.1.1"):...SNMPv3 shares same API and semantics:asyncwithSnmpSession(addr="127.0.0.1",user=User("user1",auth_key=Sha1Key(b"12345678"),priv_key=Aes128Key(b"87654321")))assession:r=awaitsession.get("1.3.6.1.2.1.1.3.0")Gufo SNMPalso allows to limit rate of outgoing requests to protect equipment
from overloading:asyncwithSnmpSession(addr="127.0.0.1",community="public",limit_rps=10)assession:asyncforoid,valueinsession.fetch("1.3.6.1.2.1.1"):...Gufo SNMPoffers various tools for developers, including a wrapper to
run a local instance of SNMP daemon:asyncwithSnmpd(),SnmpSession(addr="127.0.0.1",port=10161)assession:r=awaitsession.get("1.3.6.1.2.1.1.3.0")FeaturesClean async and blocking API.SNMP v1/v2c/v3 support.SNMP v3 User Security Model:Authentication: HMAC-MD5-96, HMAC-SHA-96.Privacy: DES, AES128.Engine ID discovery.High-performance.Built with security in mind.Zero-copy BER parsing.Query rate limiting.Full Python typing support.Editor completion.Well-tested, battle-proven code.Thoroughly check compatibility with various network equipment.Further RoadmapSHA2 family of hashes.AES256 encryption.SNMP Trap and Inform collector.Incorporation of theNOC'sCompiled MIBinfrastructure.On Gufo StackThis product is a part ofGufo Stack- the collaborative effort
led byGufo Labs. Our goal is to create a robust and flexible
set of tools to create network management software and automate
routine administration tasks.To do this, we extract the key technologies that have proven themselves
in theNOCand bring them as separate packages. Then we work on API,
performance tuning, documentation, and testing. TheNOCuses the final result
as the external dependencies.Gufo Stackmakes theNOCbetter, and this is our primary task. But other products
can benefit fromGufo Stacktoo. So we believe that our effort will make
the other network management products better.