Coder Social home page Coder Social logo

pysnmp's Introduction

SNMP library for Python

PyPI Python Versions CI GitHub license

This is a pure-Python, open source and free implementation of v1/v2c/v3 SNMP engine distributed under 2-clause BSD license.

The PySNMP project was initially sponsored by a PSF grant. Thank you!

This version is a fork of Ilya Etingof's project etingof/pysnmp. Ilya sadly passed away on 10-Aug-2022. Announcement here. His work is still of great use to the Python community and he will be missed.

Features

  • Complete SNMPv1/v2c and SNMPv3 support
  • SMI framework for resolving MIB information and implementing SMI Managed Objects
  • Complete SNMP entity implementation
  • USM Extended Security Options support (3DES, 192/256-bit AES encryption)
  • Extensible network transports framework (UDP/IPv4, UDP/IPv6)
  • Asynchronous socket-based IO API support
  • Asyncio integration
  • PySMI integration for dynamic MIB compilation
  • Built-in instrumentation exposing protocol engine operations
  • Python eggs and py2exe friendly
  • 100% Python, works with Python 2.4 though 3.7
  • MT-safe (if SnmpEngine is thread-local)

Features, specific to SNMPv3 model include:

  • USM authentication (MD5/SHA-1/SHA-2) and privacy (DES/AES) protocols (RFC3414, RFC7860)
  • View-based access control to use with any SNMP model (RFC3415)
  • Built-in SNMP proxy PDU converter for building multi-lingual SNMP entities (RFC2576)
  • Remote SNMP engine configuration
  • Optional SNMP engine discovery
  • Shipped with standard SNMP applications (RC3413)

Download & Install

The PySNMP software is freely available for download from PyPI and GitHub.

Just run:

$ pip install pysnmplib

To download and install PySNMP along with its dependencies:

Besides the library, command-line SNMP utilities written in pure-Python could be installed via:

$ pip install snmpclitools

and used in the very similar manner as conventional Net-SNMP tools:

$ snmpget.py -v3 -l authPriv -u usr-md5-des -A authkey1 -X privkey1 demo.snmplabs.com sysDescr.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux zeus 4.8.6.5-smp #2 SMP Sun Nov 13 14:58:11 CDT 2016 i686

Examples

PySNMP is designed in a layered fashion. Top-level and easiest to use API is known as hlapi. Here's a quick example on how to SNMP GET:

from pysnmp.hlapi import *

iterator = getCmd(SnmpEngine(),
                  CommunityData('public'),
                  UdpTransportTarget(('demo.snmplabs.com', 161)),
                  ContextData(),
                  ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0)))

errorIndication, errorStatus, errorIndex, varBinds = next(iterator)

if errorIndication:  # SNMP engine errors
    print(errorIndication)
else:
    if errorStatus:  # SNMP agent errors
        print('%s at %s' % (errorStatus.prettyPrint(), varBinds[int(errorIndex)-1] if errorIndex else '?'))
    else:
        for varBind in varBinds:  # SNMP response contents
            print(' = '.join([x.prettyPrint() for x in varBind]))

This is how to send SNMP TRAP:

from pysnmp.hlapi import *

errorIndication, errorStatus, errorIndex, varBinds = next(
    sendNotification(
        SnmpEngine(OctetString(hexValue='8000000001020304')),
        UsmUserData('usr-sha-aes128', 'authkey1', 'privkey1',
                    authProtocol=usmHMACSHAAuthProtocol,
                    privProtocol=usmAesCfb128Protocol),
        UdpTransportTarget(('demo.snmplabs.com', 162)),
        ContextData(),
        'trap',
        NotificationType(ObjectIdentity('SNMPv2-MIB', 'authenticationFailure'))
    )
)

if errorIndication:
    print(errorIndication)

We maintain publicly available SNMP Agent and TRAP sink at demo.snmplabs.com. You are welcome to use it while experimenting with whatever SNMP software you deal with.

โš ๏ธ This is no longer the case as the snmplabs.com site is now defunct

$ python3 examples/hlapi/asyncore/sync/manager/cmdgen/usm-sha-aes128.py
SNMPv2-MIB::sysDescr.0 = SunOS zeus.snmplabs.com 4.1.3_U1 1 sun4m
$
$ python3 examples//hlapi/asyncore/sync/agent/ntforg/v3-inform.py
SNMPv2-MIB::sysUpTime.0 = 0
SNMPv2-MIB::snmpTrapOID.0 = SNMPv2-MIB::warmStart
SNMPv2-MIB::sysName.0 = system name

Other than that, PySNMP is capable to automatically fetch and use required MIBs from HTTP, FTP sites or local directories. You could configure any MIB source available to you (including this one) for that purpose.

For more example scripts please refer to examples section at pysnmp web site.

Documentation

Library documentation and examples can be found at the pysnmp project site.

If something does not work as expected, please open an issue at GitHub or post your question on Stack Overflow or try browsing pysnmp mailing list archives.

Bug reports and PRs are appreciated! ;-)

Copyright (c) 2005-2019, Ilya Etingof. All rights reserved.

pysnmp's People

Contributors

acspike avatar ajasnosz avatar astralblue avatar bieniu avatar carlfk avatar cfeazeti avatar drrbreese avatar ericwb avatar etingof avatar fabriziovanni avatar ffourcot avatar gerrat avatar johnthagen avatar keuko avatar lissagreense avatar mattsb42-aws avatar mcfletch avatar omrozowicz-splunk avatar roguelazer avatar rowshi avatar rwallen avatar ryanfaircloth avatar ryban avatar semantic-release-bot avatar stefanor avatar urnest avatar verrio avatar vincentbernat avatar wallies avatar xel64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pysnmp's Issues

Some authentication/privacy combinations are not working correctly

Hi there!
I am in the process of implementing a SNMPv3 agent here at work.
For testing purposes i test our agent with net-snmp (v5.10-git@82862da) with OpenSSL-1.1.1.
And i also test against the pysnmp testserver demo.pysnmp.com.

While doing so i found that some authentication/privacy algorythms are maybe not working as expected?
I am interested in finding out why and how, also to make my own implementation better.
As far as i can tell the error could also be on the net-snmp side, but i am unsure.
Is anyone interested in working on this?

Here a table of all tested combinations:

pysnmp 0: None 1: DES 2: 3DES 3: AES128 4: AES192 4: AES192C 5: AES256 5: AES256C
0: None OK --- --- --- --- --- --- ---
1: MD5 OK OK not supported OK Decryption error OK Decryption error OK
2: SHA1 OK OK not supported OK Decryption error OK Decryption error OK
3: SHA2-224 Decryption error Decryption error not supported Decryption error Decryption error Decryption error Decryption error Decryption error
4: SHA2-256 OK OK not supported OK Decryption error OK Decryption error OK
5: SHA2-384 OK OK not supported OK Decryption error OK Decryption error OK
6: SHA2-512 Timeout! Decryption error not supported Timeout! Decryption error Timeout! Decryption error Timeout!

legend:
"---": impossible combination
"not supported": net-snmp does not support 3DES, so it can't be tested
"Timeout": pysnmp is not sending anything after time syncronisation -> needs fix!
"Decryption error": pysnmp has sent an answer, but net-snmp couldn't decrypt -> those ones need fix

The "C" at the end of privacy algos is for "Cisco", which means key localization is done with reeder-draft.
Those without the "C" have key localization according to blumethal-draft.
While it seems that the reeder implementation is the "standard" for pysnmp, the blumenthal ones don't seem to work at all?

Readme examples import pysnmplib

readme example:

from pysnmplib.hlapi import *

wrong name:

>>> from pysnmplib.hlapi import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pysnmplib'

right name:

>>> import pysnmp 
>>> pysnmp.__file__
'/home/videoteam/snmp/lib/python3.9/site-packages/pysnmp/__init__.py'

MIB files available as pyc files fail to compile

Hi all,

recently we ran into an issue where our MIB file was compiled to a .pyc file and added as a DirMibSource on the parent directory. The pysnmp.smi.builder fails to load due to a marshal error.

To reproduce:

  • Compile an MIB using mibdump
  • compile the .py mib to a .pyc MIB "python -m compileall -f -b ."
  • remove the .py mib and add the directory as a source to an mibBuilder
  • attempt to resolve an oid from the mib

Example:

from pathlib import Path
from pysnmp.smi.builder import *

builder = MibBuilder()
builder.addMibSources(DirMibSource(Path(__file__).parent.joinpath("mibs")))

builder.loadModule(...)

I can't share the full traceback, but here's what I'm allowed

File "...pysnmp/smi/builder.py", line 336, in loadModule
    codeObj, sfx = mibSource.read(modName)
File "...pysnmp/smi/builder.py", line 138, in read
     return marshal.loads(pycData), pycSfx
ValueError: bad marshal data (unknown type code)

I believe the error is with this line in the builder code
return marshal.loads(pycData) ...
Please see https://stackoverflow.com/questions/25126282/marshal-loads-function-does-not-load-pyc-contents-to-code-object
We are using python 3.10, which apparently increases the header size to 16 instead of 12

Locate/create unit tests for the solution

The original project did not have effective unit tests in tree we don't know how it was tested. Today the primary consumer "Splunk Connect for SNMP" implements integration and system tests. This project should have its own unit tests.

Sending requests from specific interface not working.

I am seeing the below error when i am trying to send SNMP request over a specific interface.
Version being used pysnmp-4.4.12

poll error: Traceback (most recent call last):
;  File "/usr/lib/python3.7/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 149, in handle_write
    self.socket, outgoingMessage, transportAddress
;  File "/usr/lib/python3.7/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 35, in <lambda>
    self._sendto = lambda s, b, a: s.sendto(b, a)
;OSError: [Errno 22] Invalid argument
;
During handling of the above exception, another exception occurred:

;Traceback (most recent call last):
;  File "/usr/lib/python3.7/site-packages/pysnmp/carrier/asyncore/dispatch.py", line 46, in runDispatcher
    use_poll=True, map=self.__sockMap, count=1)
;  File "/usr/lib/python3.7/asyncore.py", line 207, in loop
    poll_fun(timeout, map)
;  File "/usr/lib/python3.7/asyncore.py", line 188, in poll2
    readwrite(obj, flags)
;  File "/usr/lib/python3.7/asyncore.py", line 123, in readwrite
    obj.handle_error()
;  File "/usr/lib/python3.7/asyncore.py", line 110, in readwrite
    obj.handle_write_event()
;  File "/usr/lib/python3.7/asyncore.py", line 441, in handle_write_event
    self.handle_write()
;  File "/usr/lib/python3.7/site-packages/pysnmp/carrier/asyncore/dgram/base.py", line 155, in handle_write
    raise error.CarrierError('sendto() failed for %s: %s' % (transportAddress, sys.exc_info()[1]))
;pysnmp.carrier.error.CarrierError: sendto() failed for ('192.170.1.2', 161): [Errno 22] Invalid argumentcaused by <class 'OSError'>: [Errno 22] Invalid argument
caused by <class 'pysnmp.carrier.error.CarrierError'>: sendto() failed for ('192.170.1.2', 161): [Errno 22] Invalid argumentcaused by <class 'OSError'>: [Errno 22] Invalid argument

Below is the sample code i am using. Let me know what am i missing here ?

import pysnmp
from pysnmp.hlapi import *
from pysnmp.carrier.asyncore.dgram import udp

OID = '1.3.6.1.2.1.2.2.1.2'
host = '192.170.1.2'

data = CommunityData("test")

result = {}
transportAddress = udp.UdpTransportAddress((host, 161))
transportAddress.setLocalAddress(("10.64.3.176", "0"))

try:
    for (errorIndication, errorStatus, errorIndex, varBinds) in nextCmd(SnmpEngine(),
                                                                          data,
                                                                          UdpTransportTarget(transportAddress, timeout=2.0),
                                                                          ContextData(),
                                                                          ObjectType(ObjectIdentity(OID)),
                                                                          lexicographicMode=False, lookupMib=False):
        if errorIndication:
            print (errorIndication)
        elif errorStatus:
           print (errorStatus.prettyPrint())
        else:
            for varBind in varBinds:
                result[varBind[0].prettyPrint()] = str(varBind[1].prettyPrint())
            print (result)
except Exception as e:
    print(e)

Make pycryptodomex an extra dependency.

Hello.

It seems that the deceased maintainer of the previous repo was planning to remove the pycryptodomex library from required libraries and make them optional. Is there a chance the same thing is done here, so the package can be really pure Python?

In Memorial

Ref: etingof/pysnmp#427

The original developer of pysnmp has passed away this project is the likely destination of users from the original project as no other admins can be located.

Significant gaps on this fork/organization and possible solutions

A quick look around this fork and its related repos, I think the following issues are critical at this moment, if the goal is to keep pysnmp ecosystem sustainable,

  1. The releases from this fork do not have meaningful release notes compared to the origin, so honestly speaking I don't know what has changed.
  2. The release numbers (5.0.11-5.0.14) are missing for no good reasons. Such really should be avoided.
  3. Pre-releases might be hidden once the stable ones are out.
  4. The v5.0 and v5 tags are there for no good reasons.
  5. Not all pysnmp projects are forked under https://github.com/pysnmp.
  6. Not clear what's the missions and plans for the whole organization (after such a long period), so it is hard to build trust here.
  7. Issues of the origin repo are not processed, so no traffic is clearly redirected here nor drive further development of this ecosystem.
  8. The homepage was not forked so new users do not have reliable materials to get started. I already forked the web contents and hosted them at https://www.pysnmp.com as a new start, so if possible I'd like to move the repo under https://github.com/pysnmp.

I helped revive many open source projects in the past, and I'd like to see if there is any assistance needed here.

"Excessive instance identifier sub-OIDs left at MibTableRow" error for a long string

I'm using pysnmplib 5.0.21 tried to snmp walk IP-MIB::ipAddressTable and got the following error:

Traceback (most recent call last):
File "/usr/src/myapp/adapter_internals/adapter.py", line 94, in collect
await request.execute(connector)
File "/usr/src/myapp/adapter_internals/parser.py", line 84, in execute
return await connector.walk(
File "/usr/src/myapp/adapter_internals/snmp.py", line 304, in walk
error_indication, error_status, error_index, response_var_binds = await bulkCmd(
File "/usr/src/myapp/venv/lib/python3.10/site-packages/pysnmp/hlapi/asyncio/cmdgen.py", line 501, in bulkCmd
vbProcessor.makeVarBinds(snmpEngine, varBinds), __cbFun,
File "/usr/src/myapp/venv/lib/python3.10/site-packages/pysnmp/hlapi/varbinds.py", line 39, in makeVarBinds
__varBinds.append(varBind.resolveWithMib(mibViewController, ignoreErrors=False))
File "/usr/src/myapp/venv/lib/python3.10/site-packages/pysnmp/smi/rfc1902.py", line 884, in resolveWithMib
self.__args[1] = ObjectIdentity(self.__args[1]).resolveWithMib(mibViewController)
File "/usr/src/myapp/venv/lib/python3.10/site-packages/pysnmp/smi/rfc1902.py", line 450, in resolveWithMib
self.__indices = rowNode.getIndicesFromInstId(suffix)
File "/usr/src/myapp/venv/lib/python3.10/site-packages/pysnmp/smi/mibs/SNMPv2-SMI.py", line 1256, in getIndicesFromInstId
raise error.SmiError(
pysnmp.smi.error.SmiError: Excessive instance identifier sub-OIDs left at MibTableRow((1, 3, 6, 1, 2, 1, 4, 32, 1), None): 0.0.3.128

I checked the walk output and see this refers to a long string. Is there any known issue parsing this kind of value?

IP-MIB::ipAddressPrefix.ipv6z."fe80:00:00:00:d4b2:6bff:fe76:a174%3" = 1.3.6.1.2.1.4.32.1.5.732.4.20.254.128.0.0.0.0.0.0.212.178.107.255.254.118.161.116.0.0.0.0.0.0.0.3.128
IP-MIB::ipAddressPrefix.ipv6z."fe80:00:00:00:d4b2:6bff:fe76:a174%4" = 1.3.6.1.2.1.4.32.1.5.314.4.20.254.128.0.0.0.0.0.0.212.178.107.255.254.118.161.116.0.0.0.0.0.0.0.4.128

cmdgen.AsynCommandGenerator.cfgCmdGen produces TypeError (missing 1 required positional argument: 'contextName')

Running the following sequence of commands cause a Traceback:

(venv) $ python
Python 3.10.6 (main, Aug 17 2022, 13:22:50) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pysnmp.entity.rfc3413.oneliner import cmdgen
>>> _cmdGen = cmdgen.AsynCommandGenerator()
>>> authData = cmdgen.CommunityData('public', mpModel=0)
>>> transportTarget = cmdgen.UdpTransportTarget(
...     ('127.0.0.1', 161), timeout=1, retries=0)
>>> _cmdGen.cfgCmdGen(authData, transportTarget)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<redacted path>/venv/lib/python3.10/site-packages/pysnmp/entity/rfc3413/oneliner/cmdgen.py", line 40, in cfgCmdGen
    return self.lcd.configure(self.snmpEngine, authData, transportTarget)
TypeError: CommandGeneratorLcdConfigurator.configure() missing 1 required positional argument: 'contextName'
>>> 
(venv) $ pip freeze
certifi==2022.6.15
charset-normalizer==2.1.1
idna==3.3
ply==3.11
pycryptodomex==3.15.0
pysnmp-pyasn1==1.1.2
pysnmp-pysmi==1.1.10
pysnmplib==5.0.17
requests==2.28.1
urllib3==1.26.12

From what I can see this mandatory contextName parameter is not even used in class CommandGeneratorLcdConfigurator anyway, so IMO it could be safely removed or at least made an optional parameter to avoid this Traceback.

Compatibility with `asn1`

asn1 recently got a new maintainer and released v0.5.0 which has a change that is not compatible. See discussion in pyasn1/pyasn1#30

It would be great if pysnmp-pyasn1 could be dropped and asn1 used to resolve the below dependency conflict.

pysnmp-pyasn1==1.1.2
  - pysnmplib==5.0.21 [requires: pysnmp-pyasn1>=1.0.3,<2.0.0]
    - brother==2.3.0 [requires: pysnmplib>=5.0.21]
pyasn1==0.4.8
  - adb-shell==0.4.3 [requires: pyasn1]
    - androidtv==0.0.70 [requires: adb-shell>=0.4.0]
  - oauth2client==4.1.3 [requires: pyasn1>=0.1.7]
  - pyasn1-modules==0.2.8 [requires: pyasn1>=0.4.6,<0.5.0]
    - google-auth==2.17.3 [requires: pyasn1-modules>=0.2.1]
      - gassist-text==0.0.10 [requires: google-auth>=0.3.0,<3]
      - google-api-core==2.11.0 [requires: google-auth>=2.14.1,<3.0dev]
        - google-api-python-client==2.71.0 [requires: google-api-core>=1.31.5,<3.0.0dev,!=2.3.0,!=2.2.*,!=2.1.*,!=2.0.*]
        - google-cloud-pubsub==2.13.11 [requires: google-api-core>=1.32.0,<3.0.0dev,!=2.7.*,!=2.6.*,!=2.5.*,!=2.4.*,!=2.3.*,!=2.2.*,!=2.1.*,!=2.0.*]
          - google-nest-sdm==2.2.4 [requires: google-cloud-pubsub>=2.1.0]
      - google-api-python-client==2.71.0 [requires: google-auth>=1.19.0,<3.0.0dev]
      - google-auth-httplib2==0.1.0 [requires: google-auth]
        - google-api-python-client==2.71.0 [requires: google-auth-httplib2>=0.1.0]
      - google-auth-oauthlib==1.0.0 [requires: google-auth>=2.15.0]
        - google-nest-sdm==2.2.4 [requires: google-auth-oauthlib>=0.4.1]
        - gspread==5.5.0 [requires: google-auth-oauthlib>=0.4.1]
      - google-nest-sdm==2.2.4 [requires: google-auth>=1.22.0]
      - gspread==5.5.0 [requires: google-auth>=1.12.0]
    - oauth2client==4.1.3 [requires: pyasn1-modules>=0.0.5]
    - slixmpp==1.8.2 [requires: pyasn1-modules]
      - aioharmony==0.2.10 [requires: slixmpp]
  - pysmb==1.2.9.1 [requires: pyasn1]
    - pyairvisual==2022.12.1 [requires: pysmb>=1.2.6,<2.0.0]
  - python-jose==3.3.0 [requires: pyasn1]
    - pycognito==2022.12.0 [requires: python-jose>=3.2.0]
      - hass-nabucasa==0.66.2 [requires: pycognito==2022.12.0]
    - warrant-lite==1.0.4 [requires: python-jose>=3.0,<4.0]
      - pyoverkiz==1.7.7 [requires: warrant-lite>=1.0.4,<2.0.0]
  - rsa==4.8 [requires: pyasn1>=0.1.3]
    - adb-shell==0.4.3 [requires: rsa]
      - androidtv==0.0.70 [requires: adb-shell>=0.4.0]
    - google-auth==2.17.3 [requires: rsa>=3.1.4,<5]
      - gassist-text==0.0.10 [requires: google-auth>=0.3.0,<3]
      - google-api-core==2.11.0 [requires: google-auth>=2.14.1,<3.0dev]
        - google-api-python-client==2.71.0 [requires: google-api-core>=1.31.5,<3.0.0dev,!=2.3.0,!=2.2.*,!=2.1.*,!=2.0.*]
        - google-cloud-pubsub==2.13.11 [requires: google-api-core>=1.32.0,<3.0.0dev,!=2.7.*,!=2.6.*,!=2.5.*,!=2.4.*,!=2.3.*,!=2.2.*,!=2.1.*,!=2.0.*]
          - google-nest-sdm==2.2.4 [requires: google-cloud-pubsub>=2.1.0]
      - google-api-python-client==2.71.0 [requires: google-auth>=1.19.0,<3.0.0dev]
      - google-auth-httplib2==0.1.0 [requires: google-auth]
        - google-api-python-client==2.71.0 [requires: google-auth-httplib2>=0.1.0]
      - google-auth-oauthlib==1.0.0 [requires: google-auth>=2.15.0]
        - google-nest-sdm==2.2.4 [requires: google-auth-oauthlib>=0.4.1]
        - gspread==5.5.0 [requires: google-auth-oauthlib>=0.4.1]
      - google-nest-sdm==2.2.4 [requires: google-auth>=1.22.0]
      - gspread==5.5.0 [requires: google-auth>=1.12.0]
    - oauth2client==4.1.3 [requires: rsa>=3.1.4]
    - python-jose==3.3.0 [requires: rsa]
      - pycognito==2022.12.0 [requires: python-jose>=3.2.0]
        - hass-nabucasa==0.66.2 [requires: pycognito==2022.12.0]
      - warrant-lite==1.0.4 [requires: python-jose>=3.0,<4.0]
        - pyoverkiz==1.7.7 [requires: warrant-lite>=1.0.4,<2.0.0]
  - slixmpp==1.8.2 [requires: pyasn1]
    - aioharmony==0.2.10 [requires: slixmpp]

Update in asyncio code

Hi @ryanfaircloth,
Can you please update the asyncio code part per new conventions async/await ?
Following two lines need to be changed-
@asyncio.coroutine -> async def // recommended way to create async function
asyncio.Future() -> asyncio.get_running_loop().create_future() // recommended way to create future

Regards

snmplabs.com site now points to malicious site

The message in the README

This is no longer the case as the snmplabs.com site is now defunct

The domain has been taken over and is used to deliver a malware message attempting to confuse users into falling for a scam.

Recommend removing any reference to snmplabs.com completely from all files.

SnmpEngine() autogenerated snmpengineid differs on windows and linux

Hi, I've noticed the code

SnmpEngine().snmpEngineID.prettyPrint()

as run on Windows Python would actually generate shorter SNMPEngineID (20 characters) than on Linux python instance (34 characters). Taking into consideration, that first characters are always same representing type, company id, and format used, there's very little of remaining "random" bytes left, making possibility of generating duplicate ID (maybe?) on windows.

I haven't been able to figure out how the engineid is generated, but would it be nice to have consistent ID's generated on any platform.
Same problem is present also in the original code etingof/pysnmp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.