# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-easysnmp VERSION= 0.2.6 KEYWORDS= python VARIANTS= v12 v11 SDESC[v11]= Library based on official Net-SNMP bindings (3.11) SDESC[v12]= Library based on official Net-SNMP bindings (3.12) HOMEPAGE= https://github.com/kamakazikamikaze/easysnmp CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPI/e/easysnmp DISTFILE[1]= easysnmp-0.2.6.tar.gz:main DF_INDEX= 1 SPKGS[v11]= single SPKGS[v12]= single OPTIONS_AVAILABLE= PY312 PY311 OPTIONS_STANDARD= none VOPTS[v11]= PY312=OFF PY311=ON VOPTS[v12]= PY312=ON PY311=OFF BUILD_DEPENDS= net-snmp:dev:standard BUILDRUN_DEPENDS= net-snmp:primary:standard USES= ssl:dev DISTNAME= easysnmp-0.2.6 GENERATED= yes [PY311].USES_ON= python:v11,sutools [PY312].USES_ON= python:v12,sutools [FILE:3115:descriptions/desc.single] Easy SNMP ========= |Python Code Style| |Build Status| |Discussions| |License| .. image:: https://raw.githubusercontent.com/easysnmp/easysnmp/master/images/easysnmp-logo.png :alt: Easy SNMP Logo Artwork courtesy of [Open Clip Art Library] Introduction ------------ Easy SNMP is a fork of `Net-SNMP Python Bindings `_ that attempts to bring a more Pythonic interface to the library. Check out the `Net-SNMP website `_ for more information about SNMP. This module provides a full-featured SNMP client API and supports all dialects of the SNMP protocol. Why Another Library? -------------------- - The `original Net-SNMP Python library `_ is a great starting point but is quite un-Pythonic and lacks proper unit tests and documentation. - [PySNMP] is entirely written in Python and therefore has a huge performance hit. In some brief tests, I estimate that both the Net-SNMP Python bindings and Easy SNMP are more than 4 times faster than PySNMP. Further to this, PySNMP has an even less Pythonic interface than the official Net-SNMP bindings. - Many other libraries like [Snimpy] are sadly based on PySNMP, so they also suffer performance penalty. Quick Start ----------- There are primarily two ways you can use the Easy SNMP library: 1. By using a Session object which is most suitable when you want to request multiple pieces of SNMP data from a source: .. code:: python from easysnmp import Session # Create an SNMP session to be used for all our requests session = Session(hostname='localhost', community='public', version=2) # You may retrieve an individual OID using an SNMP GET location = session.get('sysLocation.0') # You may also specify the OID as a tuple (name, index) # Note: the index is specified as a string as it can be of other types than # just a regular integer contact = session.get(('sysContact', '0')) # And of course, you may use the numeric OID too description = session.get('.1.3.6.1.2.1.1.1.0') # Set a variable using an SNMP SET session.set('sysLocation.0', 'The SNMP Lab') # Perform an SNMP walk system_items = session.walk('system') # Each returned item can be used normally as its related type (str or int) # but also has several extended attributes with SNMP-specific information for item in system_items: print '{oid}.{oid_index} {snmp_type} = {value}'.format( oid=item.oid, oid_index=item.oid_index, snmp_type=item.snmp_type, value=item.value ) 2. By using Easy SNMP via its simple interface which is intended for one-off operations (where you wish to specify all details in the request): .. code:: python from easysnmp import snmp_get, snmp_set, snmp_walk # Grab a single piece of information using an SNMP GET snmp_get('sysDescr.0', hostname='localhost', community='public', version=1) # Perform an SNMP SET to update data snmp_set( [FILE:100:distinfo] 8326df1bc8d9cdb29e3e43d55d56cb24c0d98f6997a7a1571f32815e8bdfef15 43038 easysnmp-0.2.6.tar.gz [FILE:465:patches/patch-setup.py] --- setup.py.orig 2022-07-16 15:53:20 UTC +++ setup.py @@ -55,6 +55,9 @@ else: elif flag[:2] == '-f': # -flat_namespace link_args.append(flag) pass_next = False + elif flag[:10] == '-Wl,-rpath': + link_args.append(flag) + pass_next = False # link_args += [flag for flag in s_split(netsnmp_libs) if flag[:2] == '-f'] libs = [flag[2:] for flag in s_split(netsnmp_libs) if flag[:2] == '-l']