Changelog¶
Release 2.0.1¶
[added] Add support for hostnames (instead of only IP-addresses)
[fixed] Do not crash if
sys.stdoutis empty (f.ex. when running as Windows service). Patch provided by M. Lehn.[docs] Minor fixes to the project documentation.
[support] Add forwards-compatibility to Sphinx 8.0. Patch provided by J. Addison. Windows service). Patch provided by M. Lehn.
[support] Add new import alias
puresnmp.Authandpuresnmp.Privfor easier imports[support] Switch to “src” layout for the project source code.
[support] Display more readable name for plugin-loaders
[support] Minor type-check fixes
Release 2.0.0post1 - Maintenance release¶
This fixes the incorrectly provided extra
restin the dependency metadata. This extra has become obsolete and removing it fixed versioning errors when installingpuresnmp.
Release 2.0 (starting from and including 2.0.0a0)¶
Warning
This is a major upgrade! It is not compatible with client-code based on puresnmp v1.x
Refer to Upgrading from v1.x to v2.x for details
[changed] Changed back from
poetrytosetuptoolsdue to too many stumbling blocks during development withpoetry.[changed] Main API functions moved into “client” classes
ClientandPyWrapper. See Upgrading from v1.x to v2.x.[changed] Extracted
x690processing into separate packagex690. This changed the behaviour ofx690.types.ObjectIdentifier[changed] “continuing” OIDs of bulk-walks removed from logging. This caused too much noise in general and was only useful during development of puresnmp itself.
[changed] The old inconsistent “VarBind” class has been split into
puresnmp.varbind.VarBindandpuresnmp.varbind.PyVarBind[changed] Some data-types now correctly wrap
Noneinstead ofb"":NoSuchObject
NoSuchInstance
EndOfMibView
[added] Type-Hints for table and bulktable calls
It is now possible to attach a “TypedDict” reference to [bulk]table calls via the
_rowtypeargument.[added] Support for SNMPv3
Builting support for auth-protocols “md5” and “sha1”.
Encryption provided by the plugin package
puresnmp-crypto. Installable by activating the[crypto]“extra” in your dependencies.
[added] Plugin based architecure to support multiple protocols (see Plugins)
[added] Builtin support for the SNMP IPv4 data-type. IPv6 has no defined data-type in the context of SNMP. Instead it is defined in a separate RFC/MIB which is why it is not inclued.
[added] New exception types based on RFC 3416
[added] Allow temporarily overriding client defaults via
puresnmp.api.raw.Client.reconfigure()
Release 1.10.2.post1¶
This is a “house-keeping” commit. No new features or fixes are introduced.
[changed] Packaging and publishing switched over to poetry
Release 1.10.2¶
[fixed] Speed improvements for overflowing counters (See #88 by Alexey Minevich)
Release 1.10.1¶
[fixed] Don’t crash with an
IndexErrorwhen an error-status is returned from a device without specifying an offending OID (See #89 by Lopolio)
Release 1.10.0¶
[support] Expose SNMP “version” argument to more API endpoints for extended SNMPv1 support (See #87 by Nikolaj Rahbek). Impacted functions are:
puresnmp.api.pythonic.get()puresnmp.api.pythonic.getnext()puresnmp.api.pythonic.walk()puresnmp.api.pythonic.set()puresnmp.api.pythonic.multiset()puresnmp.api.raw.get()puresnmp.api.raw.getnext()puresnmp.api.raw.set()puresnmp.api.raw.multiset()
Release 1.9.1¶
[fixed] Fix a regression introduced by 1.9 causing exception message to get dropped (#85)
Release 1.9.0.post1¶
[docs] Add dummy changelog entry for 1.8.0
Release 1.9.0¶
[added] Added
TrapInfo.origincontaining the IP-address of the host emitting the SNMP Trap (See #79, by Richard Smith).[added] Allow specifying the SNMP version on “set” operations (See #77, by Mischa Spiegelmock).
[added] Support for SNMPv1 for
multigetnext(by Mischa Spiegelmock)[support] Better(?) type hinting
[support] Introdce
puresnmp.snmpwith SNMP-specific data structures (refactored out frompuresnmp.pdu.[support] Some unit-test house-keeping for Python < 3.6
Release 1.8.0¶
This release never existed due to a mixup with the package version in a pull-request.
Release 1.7.4¶
[fixed] Removed a regression from 1.7.0: Table outputs should be lists in the 1.x branch as documented (#74)
[fixed] Removed a type-hint which tripped up mypy (#75)
[fixed] Fix decoding of unsigned integer values (#76)
Release 1.7.3¶
[support] Make
bulktable()available via the package root (#73)
Release 1.7.2¶
[fixed] Fixed a regression introduced in 1.6.3 (commit 7e559d5d) causing modified values for
BUFFER_SIZEandRETRIESto be ignored.
Release 1.7.1¶
[fixed] Version 1.7.0 introduced a regression which caused
VarBindinstances to lose the ability to be indexed. This is now fixed.
Release 1.7.0¶
[added] A new function
bulktableis added to all external APIs:puresnmp.api.raw.bulktablepuresnmp.api.pythonic.bulktablepuresnmp.aio.api.raw.bulktablepuresnmp.aio.api.pythonic.bulktable
This function returns a pseudo-table (just like the normal
tablefunction) but uses more efficient SNMP “bulk” requests under the hood.[added] The library now knows how to deal with “T61” string encodings and supports them if they are returned from a device (or sent to a device).
[support] The
tableandbulktablefunctions no longer require thenum_base_nodesargument as it was redundant with the OID. Now, if it is used, it will emit a deprecation warning and will be removed in a future release.[support] The
bulkwalktable now also takes an optional timeout argument.[support] The default TCP timeout is now set via the module-level variable
puresnmp.const.DEFAULT_TIMEOUT. This can still be overridden by using thetimeoutargument on function calls.[support] (internal) The X.690
tablifyfunction now optionally takes an OID as table “base”, which is easier than passing in the number of base-nodes.[fixed] The “retries” and “buffer_size” arguments were not properly handed over to the “transport” layer which is now fixed.
[quality] More automation via GitHub actions (fixed in
1.7.0.post1)[quality] Code cleanup and type hint improvements. But there’s still a lot of work to be done on the typing front.
Release 1.6.4¶
[fixed]
puresnmpis now also Python 3.8 compatible
Release 1.6.3¶
[fixed] Network socket is now properly closed when the maximum number of retries has reached. This fixes emissions of Python resource warnings.
Release 1.6.2¶
[support] (1.6.2.post1) - Type hints for
puresnmp.x690.types.ObjectIdentifierimproved[fixed] Counter32 and Counter64 values no longer increase above max-value and properly wrap back to
0as defined in RFC-2578 Section 7.1.6 and RFC-2578 Section 7.1.10.If a value is more than one unit above the max-value the behaviour is undefine in that RFC as it assumes monotonically increasing values. As a design decision I decided to initialise the value using the overflow amount. So a counter initialised to
40above maximum, will have the value40.
Release 1.6.1¶
[fixed] Regression caused in 1.6.0 due to socket timeout argument.
Release 1.6.0¶
[new] SNMPv2 Trap support (see the cookbook for an example).
[internal] Network transport functions are now wrapped by a class.
Release 1.5.2.post1¶
[fixed] Add missing file for PEP-561 compliance.
Release 1.5.2¶
[fixed] No longer raise an exception when using
snmp.setwith an absolute OID (an OID with leading dot).
Release 1.5.1¶
[fixed] Socket connections no longer read multiple times from the same UDP socket. An appropriate error is now raised
puresnmp.x690.exc.InvalidValueLengthwhen a returned package is larger than the default buffer-size.To increase the buffer size, simply set the appropriate value to
puresnmp.transport.BUFFER_SIZE.
Release 1.5.0¶
[new] The buffer-size of low-level socket calls can now be modified via the global variable
puresnmp.transport.BUFFER_SIZE.[new]
Sequenceinstances are now “sized” (it is now possible to calllen()on a sequence).[new] Applied missing bugfixes to the async code (ensured that the aio API behaves the same way as the normal API).
[fix] Properly handle
endOfMibViewmarkers in responses (Issue #54)[fix] Synced bugfixes of the non-async code with the async code. They should now behave identically.
[fix] An error message in
bulkgetresponses now shows the proper OID count.[support] Reading “ASCII/Hex” files in unit-tests is now a bit more flexible and can read more formats.
Release 1.4.1¶
[fix] Fixed a regression which was introduced in
v1.3.2
Release 1.4.0¶
[new] PEP 561 compliance (since 1.4.0.post1)
[new] asyncio support via
puresnmp.aio(Thanks to @acspike).[new] Much better error detail if the SNMP agent returns a response with an error-code. See
puresnmp.exc.ErrorResponse.[new] The
ObjectIdentifierclass now has two convenience methodschildof()andparentof(). They merely delegat to__contains__but can make code more readable.
Release 1.3.2¶
[fix] Fixed a regression introduced by v1.3.1 for Python < 3.6.
Release 1.3.1¶
[fix] Fixed an endless loop caused by some network devices with broken SNMP implementations. This will now raise a FaultySNMPImplementation exception unless errors=puresnmp.api.raw.ERRORS_WARN is passed to walk operations.
Release 1.3.0¶
[new] Python 2 support (Royce Mitchell).
[new] Expose
timeoutargument in additional functions.[new] Walk operations now yield rows as they come in over the network instead of materialising them in memory (Royce Mitchell).
[new] Introduce
puresnmp.api.rawwith same signatures aspuresnmpbut for for non-pythonized output.[new]
ObjectIdentifier.from_stringnow allows a leading..[new] Collections of
ObjectIdentifierinstances are now sortable.[new] Enforce
strtype inObjectIdentifier.from_string.[new]
ObjectIdentifiernow supports__len__:len(ObjectIdentifier(1, 2, 3)) == 3
[new]
ObjectIdentifierinstances can now be converted toint(if they only have one node):int(ObjectIdentifier(5)) == 5
[new]
ObjectIdentifierinstances can now be concatenated using+:ObjectIdentifier(1) + ObjectIdentifier(2) == ObjectIdentifier(1, 2)
[new]
ObjectIdentifierinstances are now indexable:ObjectIdentifier(1, 2, 3)[1] == ObjectIdentifier(2)
[new] The SNMP type
IpAddressis now properly transcoded to the PythonIPv4Addresstype (via RFC3416).[changed]
NonASN1Typeis now deprectated. UseUnknownTypeinstead (Royce Mitchell).[fix]
ObjectIdentifier(0)is now correctly detected & transcoded.[fix]
portno longer ignores theportargument.[fix] Avoid potential error in reported
OctetStringlength.[fix] UDP connection retries are now handled properly.
[code-quality] Improved type-hints.
[code-quality] Update contribution guide, adding code-style rules. Added an appropriate
pylintrcand fixed some style violations.
Release 1.2.1¶
Clarify error message if a
bulkwalkis requested with non-iterable OIDs.
Release 1.2.0¶
Exposed access to the
timeoutvalue. Each SNMP call not takes an optionaltimeoutvalue which specifies the timeout in seconds (Thomas Kirsch).
Release 1.1.0¶
puresnmp.bulkwalk()andpuresnmp.bulkget()have been implemented.More “cookbook” examples
puresnmp.walk()andpuresnmp.table()operations now return pythonized values (as it should be).Types are now properly detected.
NonASN1Typeshould no longer show up.Walking over the end of the OID tree no longer raises an exception.
SNMP
TimeTicksare now parsed intodatetime.timedeltainstances.portis now optional forGetNextrequests (using161by default)VarBinds can now only be created with
ObjectIdentifierorstrinstances as first element.puresnmp.multiwalk()is now more generic and the backbone of bothbulkwalkandwalk.Fixed issue with ReadTheDocs
More unit tests
Internal changes for better RFC3416 conformance¶
Using real PDU “type” values (tags).
Renamed “error_code” to “error_status”.
Added error statuses from RFC3416.
Opaque now inherits from OctetString.
IpAddress now inherits from OctetString.
Added support for Counter64 values.
Raising an error when requesting too many varbinds.
Renamed
puresnmp.SnmpMessagetopuresnmp.PDU
Notable bugfixes on the 1.1.x branch¶
Some internal types leaked to the outside. This is no longer the case (fixed in
v1.1.1)Raw packets are logged using the
DEBUGlevel (“fixed” inv1.1.1).Fixed encoding of long length values (fixed in
v1.1.2)v1.1.3added minor internal fixes.Fixed IP-Address Header (fixed in
v1.1.4)Fixed signed integers (fixed in
v1.1.5)