1

I'm trying to use pysnmp to access my local lib, but without any success. For example the following code:

from pysnmp.entity.rfc3413.oneliner import cmdgen

Results in :

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.6/site-packages/pysnmp/entity/rfc3413/oneliner/cmdgen.py", line 1, in 
    from pysnmp.entity import engine, config
  File "/usr/lib/python2.6/site-packages/pysnmp/entity/engine.py", line 2, in 
    from pysnmp.proto.rfc3412 import MsgAndPduDispatcher
  File "/usr/lib/python2.6/site-packages/pysnmp/proto/rfc3412.py", line 6, in 
    from pysnmp.proto.api import verdec # XXX
  File "/usr/lib/python2.6/site-packages/pysnmp/proto/api/__init__.py", line 1, in 
    from pysnmp.proto.api import v1, v2c, verdec
  File "/usr/lib/python2.6/site-packages/pysnmp/proto/api/v1.py", line 124, in 
    class TrapPDUAPI:
  File "/usr/lib/python2.6/site-packages/pysnmp/proto/api/v1.py", line 129, in TrapPDUAPI
    agentAddress = IpAddress('0.0.0.0')
  File "/usr/lib/python2.6/site-packages/pyasn1/type/base.py", line 64, in __init__
    self._verifySubtypeSpec(value)
  File "/usr/lib/python2.6/site-packages/pyasn1/type/base.py", line 32, in _verifySubtypeSpec
    self._subtypeSpec(value, idx)
  File "/usr/lib/python2.6/site-packages/pyasn1/type/constraint.py", line 33, in __call__
    self, why
pyasn1.type.error.ValueConstraintError: ConstraintsIntersection(ConstraintsIntersection(), ValueSizeConstraint(4, 4)) failed at: ValueSizeConstraint(4, 4) failed at: [0, 0, 0, 0]

I've tried the advice present on the FAQ. But even the following line, produces the same result.

from pysnmp.proto import rfc1155, rfc1902, api

My machine is a Centos 6.5 running python 2.6.6 with pysnmp 4.2.5.

Fabricio Buzeto
  • 1,243
  • 1
  • 18
  • 29
  • This is a client machine where I'm not allowed to change much of it's current configuration to avoid conflicts with other applications. So I had to solve it using another lib that. But probably you're right, it's a version bug. – Fabricio Buzeto Jan 13 '15 at 13:57
  • So what is your pyasn1 version? I figured it is 0.0.12a in CentOS 6.5, however it is too old to work with pysnmp 4.2.5. – Ilya Etingof Jan 13 '15 at 21:22
  • Same here (0.0.12a). Thanks for trying =] – Fabricio Buzeto Jan 14 '15 at 13:11

0 Answers0