pysnmp-users Mailing List for SNMP library for Python (Page 64)
Brought to you by:
elie
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(3) |
Oct
(2) |
Nov
(4) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
(3) |
Mar
(16) |
Apr
(3) |
May
(6) |
Jun
|
Jul
(7) |
Aug
(12) |
Sep
(4) |
Oct
(2) |
Nov
(11) |
Dec
(6) |
2004 |
Jan
(1) |
Feb
(41) |
Mar
(4) |
Apr
(1) |
May
(6) |
Jun
|
Jul
(8) |
Aug
(5) |
Sep
(8) |
Oct
(10) |
Nov
(3) |
Dec
(1) |
2005 |
Jan
|
Feb
(4) |
Mar
(8) |
Apr
(4) |
May
(10) |
Jun
(5) |
Jul
(10) |
Aug
(6) |
Sep
(6) |
Oct
(39) |
Nov
(20) |
Dec
(21) |
2006 |
Jan
(14) |
Feb
(6) |
Mar
(15) |
Apr
|
May
(5) |
Jun
(16) |
Jul
(16) |
Aug
(18) |
Sep
(35) |
Oct
(12) |
Nov
(3) |
Dec
(3) |
2007 |
Jan
(12) |
Feb
(19) |
Mar
(27) |
Apr
(14) |
May
(32) |
Jun
|
Jul
(35) |
Aug
(11) |
Sep
(11) |
Oct
(6) |
Nov
(13) |
Dec
(4) |
2008 |
Jan
(7) |
Feb
(4) |
Mar
(2) |
Apr
(3) |
May
(3) |
Jun
(5) |
Jul
(5) |
Aug
(1) |
Sep
(2) |
Oct
(3) |
Nov
(19) |
Dec
(7) |
2009 |
Jan
(2) |
Feb
(2) |
Mar
(12) |
Apr
(16) |
May
(16) |
Jun
(23) |
Jul
(7) |
Aug
(2) |
Sep
(17) |
Oct
(20) |
Nov
(20) |
Dec
(5) |
2010 |
Jan
(11) |
Feb
(17) |
Mar
(20) |
Apr
(7) |
May
(6) |
Jun
(14) |
Jul
(5) |
Aug
(10) |
Sep
(23) |
Oct
(16) |
Nov
(32) |
Dec
(21) |
2011 |
Jan
(6) |
Feb
(11) |
Mar
(3) |
Apr
(1) |
May
(4) |
Jun
(1) |
Jul
(4) |
Aug
(8) |
Sep
(20) |
Oct
(9) |
Nov
(29) |
Dec
(25) |
2012 |
Jan
(2) |
Feb
(5) |
Mar
(2) |
Apr
(22) |
May
(21) |
Jun
(7) |
Jul
(6) |
Aug
(2) |
Sep
(12) |
Oct
(20) |
Nov
(17) |
Dec
(17) |
2013 |
Jan
(4) |
Feb
(4) |
Mar
(8) |
Apr
(8) |
May
(10) |
Jun
(2) |
Jul
(23) |
Aug
(12) |
Sep
(14) |
Oct
(12) |
Nov
(4) |
Dec
(18) |
2014 |
Jan
(2) |
Feb
(7) |
Mar
(3) |
Apr
(8) |
May
(7) |
Jun
(1) |
Jul
(5) |
Aug
(2) |
Sep
(8) |
Oct
|
Nov
(2) |
Dec
(1) |
2015 |
Jan
(3) |
Feb
(15) |
Mar
(14) |
Apr
(4) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(6) |
Sep
(5) |
Oct
(21) |
Nov
(43) |
Dec
(10) |
2016 |
Jan
|
Feb
(2) |
Mar
(6) |
Apr
(4) |
May
(6) |
Jun
(2) |
Jul
(6) |
Aug
(5) |
Sep
(4) |
Oct
|
Nov
(3) |
Dec
(11) |
2017 |
Jan
(1) |
Feb
(8) |
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
(9) |
Oct
(8) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Ilya E. <il...@gl...> - 2003-09-20 06:33:04
|
There seems to be a bug in the compat code. It might be fixed by the attached patch. Please, let me know otherwise. The fix would be committed to revision 3.3.6. BTW, the compat code it intended mostly to support existing codebase, for new projects I'd suggest using native 3.x API. -ilya > I just downloaded pysnmp 3.3.5, and tried to run the following code > lifted from the example on the index page of the 2.x programmer's manual > shipped in the tar file. I had to modify it slightly to add the > qualifications to the module locations for the imports. > > ----- > > from pysnmp.compat.pysnmp2x import v2c, role, asn1 > req = v2c.GETREQUEST() > req['encoded_oids'] = [ asn1.OBJECTID().encode('1.3.6.1.2.1.1.1.0') ] > tr = role.manager(('10.1.1.10', 161)) > (rawrsp, src) = tr.send_and_receive(req.encode()) > rsp = v2c.RESPONSE() > rsp.decode(rawrsp) > oids = map(lambda x:x[0], map(asn1.OBJECTID().decode, rsp['encoded_oids'])) > vals = map(lambda x: x[0](), map(asn1.decode, rsp['encoded_vals'])) > print oids > print vals > > ----- > > When I run it, I get the following: > > ----- > > Traceback (most recent call last): > File "/home/dave/tsnmp.py", line 3, in ? > req['encoded_oids'] = [ asn1.OBJECTID().encode('1.3.6.1.2.1.1.1.0') ] > File "/usr/lib/python2.2/site-packages/pysnmp/compat/pysnmp2x/v1.py", line 250, in __setitem__ > return self._wrapper_fun(self._setitem_fun, key, value) > File "/usr/lib/python2.2/site-packages/pysnmp/compat/pysnmp2x/v2c.py", line 38, in _wrapper_fun > return apply(v1.CompatBase._wrapper_fun, [self, fun ] + list(args)) > File "/usr/lib/python2.2/site-packages/pysnmp/compat/pysnmp2x/v1.py", line 96, in _wrapper_fun > raise asn1.BadArgument(why) > pysnmp.compat.pysnmp2x.asn1.BadArgument: Non-ASN1 object [VarBind(name=ObjectName('.1.3.6.1.2.1.1.1.0'), value=BindValue(unspecified=Null(None)))] at VarBindList > > ----- > > I'm running python 2.2.2 on a Redhat 9 distro. Can anyone help me out? > > Thanks, > Dave |
From: David G. M. <mac...@be...> - 2003-09-19 20:19:27
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> I just downloaded pysnmp 3.3.5, and tried to run the following code lifted from the example on the index page of the 2.x programmer's manual shipped in the tar file. I had to modify it slightly to add the qualifications to the module locations for the imports. ----- from pysnmp.compat.pysnmp2x import v2c, role, asn1 req = v2c.GETREQUEST() req['encoded_oids'] = [ asn1.OBJECTID().encode('1.3.6.1.2.1.1.1.0') ] tr = role.manager(('10.1.1.10', 161)) (rawrsp, src) = tr.send_and_receive(req.encode()) rsp = v2c.RESPONSE() rsp.decode(rawrsp) oids = map(lambda x:x[0], map(asn1.OBJECTID().decode, rsp['encoded_oids'])) vals = map(lambda x: x[0](), map(asn1.decode, rsp['encoded_vals'])) print oids print vals ----- When I run it, I get the following: ----- Traceback (most recent call last): File "/home/dave/tsnmp.py", line 3, in ? req['encoded_oids'] = [ asn1.OBJECTID().encode('1.3.6.1.2.1.1.1.0') ] File "/usr/lib/python2.2/site-packages/pysnmp/compat/pysnmp2x/v1.py", line 250, in __setitem__ return self._wrapper_fun(self._setitem_fun, key, value) File "/usr/lib/python2.2/site-packages/pysnmp/compat/pysnmp2x/v2c.py", line 38, in _wrapper_fun return apply(v1.CompatBase._wrapper_fun, [self, fun ] + list(args)) File "/usr/lib/python2.2/site-packages/pysnmp/compat/pysnmp2x/v1.py", line 96, in _wrapper_fun raise asn1.BadArgument(why) pysnmp.compat.pysnmp2x.asn1.BadArgument: Non-ASN1 object [VarBind(name=ObjectName('.1.3.6.1.2.1.1.1.0'), value=BindValue(unspecified=Null(None)))] at VarBindList ----- I'm running python 2.2.2 on a Redhat 9 distro. Can anyone help me out? Thanks, Dave |
From: John P S. <sp...@is...> - 2003-09-02 15:06:24
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> On Mon, Sep 01, 2003 at 11:42:34AM +0400, Ilya Etingof wrote: > > Oh, sorry for that. Attached is a [hopefully] fixed version of > snmpwalk.py taken from CVS. If it still does not work for you, please, let > me know. Yes, that fixed it. Thanks. |
From: Ilya E. <il...@gl...> - 2003-09-01 07:54:53
|
Oh, sorry for that. Attached is a [hopefully] fixed version of snmpwalk.py taken from CVS. If it still does not work for you, please, let me know. Thanks, ilya > I think it may still be broken. I just tried this with pysnmp-3.3.5, the > new release: |
From: John P S. <sp...@is...> - 2003-08-29 15:23:43
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> On Mon, Aug 25, 2003 at 06:11:50AM -0700, Ilya Etingof wrote: > > > Perhaps this is another small bug in the snmpwalk.py example. > > I've fixed this bug at cvs@SF. The patch against 3.3.4 is > attached. Please, let me know if it help or not. I think it may still be broken. I just tried this with pysnmp-3.3.5, the new release: % python snmpwalk.py -v2c testhost testcommunity .1.3.6.1.2.1.1 Traceback (most recent call last): File "snmpwalk.py", line 153, in ? raise error.ProtoError(errorStatus + ' at ' + \ IndexError: list index out of range net-snmp's snmpwalk gives this error: % snmpwalk -c testcommunity -v2c testhost system Error in packet. Reason: (genError) A general failure occured |
From: Ilya E. <il...@gl...> - 2003-08-29 12:02:54
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Greetings, The 3.3.5 is a major bugfix and new minor feature release. It accumulates most of the patches submitted to me over the last few months. Most important changes follow: * The examples/snmp*walk.py tools fixed not to query first OID in range by GetRequest unless explicitly specified by command line. * The -C option implemented at examples/snmp*walk.py tools to mimic Net-SNMP interface. * The manager class at pysnmp/mapping/udp/role.py fixed not to connect() to default destination as this prevents underlying socket from receiving UDP from non-default source. * rfc1902 BITS construct implemented. * Obsolete rfc1442 BIT STRING type implemented to handle outdated SNMP entities. * Make pysnmp.mapping.udp.role.manager attempting to resolve and cache default agent IP on instantiation for better performance. ...and many minor bugs fixed. Please, let me know if anything appears wrong or broken in this release. Thanks, ilya |
From: Ilya E. <il...@gl...> - 2003-08-25 13:40:00
|
Oops, messed up with attachments. The right one is attached now. > > Perhaps this is another small bug in the snmpwalk.py example. > > I've fixed this bug at cvs@SF. The patch against 3.3.4 is > attached. Please, let me know if it helps or not. |
From: Ilya E. <il...@gl...> - 2003-08-25 13:08:57
|
> Perhaps this is another small bug in the snmpwalk.py example. I've fixed this bug at cvs@SF. The patch against 3.3.4 is attached. Please, let me know if it help or not. Thanks, ilya |
From: John P S. <sp...@is...> - 2003-08-22 09:25:36
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Perhaps this is another small bug in the snmpwalk.py example. I try to walk this OID: 1.3.6.1.2.1.1.3 And the error raised is: Traceback (most recent call last): File "snmpwalk.py", line 132, in ? raise str(rsp['pdu'].values()[0]['error_status']) + ' at '\ IndexError: list index out of range Here's my v2c.Response() object printed: Response(version=Version(1), community=Community('xxxxxxxxxx'), pdu=Pdus(response=ResponsePdu(request_id=RequestId(1026), error_status=ErrorStatus(5), error_index=ErrorIndex(0), variable_bindings=VarBindList()))) I see the problem is that this line of code: raise str(rsp['pdu'].values()[0]['error_status']) + ' at '\ + str(vars[rsp.apiGenGetPdu().apiGenGetErrorIndex()-1][0]) In this case, the problem lies with the fact that vars is an empty list: >>> vars = rsp.apiGenGetPdu().apiGenGetVarBind() >>> vars [] I think the device which generated the response isn't doing something right either, but that's another problem. Take care. |
From: Ilya E. <il...@gl...> - 2003-08-13 17:11:30
|
[ skipped ] > Error: OID not increasing: [('.1.3.6.1.2.1.10.127.1.3.3.1.3.9', > '.1.3.6.1.2.1.10.127.1.3.3.1.3.10')] > 11:03:19 mcfletch@cmon:~/pysnmp-3.3.4/examples $ > > i.e. str(10) < str(9) lexically. Line 164:173 in the source, I think > this is approximately what you want (untested as of yet, as I'm not sure > which restriction is actually intended): Right, the bug here is that OIDs here are compared as literals rather than as objects. A quick (and slightly inefficient) fix attached. I'm going to rework it shortly. [ skipped ] > or (from my current code): > > if suffix: > sentinel = oids[0].split('.') > sentinel = sentinel[:-suffix] > sentinel = ".".join(sentinel) > else: > sentinel = oids[0] > ... > if not testOID.startswith( sentinel ): > break > > but that's a very different check for "end-of-table" which assumes that > the first OID doesn't run out before everything else does, (and does no > always-increasing-numbers check). BTW, there are: ObjectIdentifier.isaprefix() method for seemingly similar purpose. Thanks, ilya |
From: Mike C. F. <mcf...@ro...> - 2003-08-13 15:18:17
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Ilya Etingof wrote: >Yeah, that first GET request has been added to make snmpwalk.py behaving >closer to Net-SNMP's snmpwalk. This has been implemented to do GET >unconditionally and not to ignore [possible] errors so that's buggy. > >I've just re-worked the snmpwalk*.py code to fire GET only when >instructed from command line (-Ci) e.g. in the same way as it's done in >Net-SNMP. Please, try it out (CVS rev 1.3.2.19) and let me know in case of >any probs: > > Seems to fix that problem. You'll want to use a slightly more involved check for "is it an increasing OID value": 11:03:08 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3 .1.3.6.1.2.1.10.127.1.3.3.1.3.1 ---> '172.16.9.125' .1.3.6.1.2.1.10.127.1.3.3.1.3.2 ---> '172.16.6.38' .1.3.6.1.2.1.10.127.1.3.3.1.3.3 ---> '172.16.2.229' .1.3.6.1.2.1.10.127.1.3.3.1.3.4 ---> '172.16.4.12' .1.3.6.1.2.1.10.127.1.3.3.1.3.5 ---> '172.16.10.127' .1.3.6.1.2.1.10.127.1.3.3.1.3.6 ---> '172.16.12.175' .1.3.6.1.2.1.10.127.1.3.3.1.3.7 ---> '172.16.10.140' .1.3.6.1.2.1.10.127.1.3.3.1.3.8 ---> '172.16.118.245' .1.3.6.1.2.1.10.127.1.3.3.1.3.9 ---> '172.16.110.247' Error: OID not increasing: [('.1.3.6.1.2.1.10.127.1.3.3.1.3.9', '.1.3.6.1.2.1.10.127.1.3.3.1.3.10')] 11:03:19 mcfletch@cmon:~/pysnmp-3.3.4/examples $ i.e. str(10) < str(9) lexically. Line 164:173 in the source, I think this is approximately what you want (untested as of yet, as I'm not sure which restriction is actually intended): def cmpOID( x, y ): """just checks if we're past end of table""" x = x.split('.') y = y.split('.') return y[:len(x)-1] == x[:-1] or def cmpOID( x, y ): """converts to integers and does increasing-numbers check""" x = map(int, x.split('.')) y = map(int, y.split('.')) return y > x or (from my current code): if suffix: sentinel = oids[0].split('.') sentinel = sentinel[:-suffix] sentinel = ".".join(sentinel) else: sentinel = oids[0] ... if not testOID.startswith( sentinel ): break but that's a very different check for "end-of-table" which assumes that the first OID doesn't run out before everything else does, (and does no always-increasing-numbers check). Enjoy, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Ilya E. <il...@gl...> - 2003-08-13 14:17:18
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Yeah, that first GET request has been added to make snmpwalk.py behaving closer to Net-SNMP's snmpwalk. This has been implemented to do GET unconditionally and not to ignore [possible] errors so that's buggy. I've just re-worked the snmpwalk*.py code to fire GET only when instructed from command line (-Ci) e.g. in the same way as it's done in Net-SNMP. Please, try it out (CVS rev 1.3.2.19) and let me know in case of any probs: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pysnmp/pysnmp/examples/snmpwalk.py?only_with_tag=version-3-branch Regarding 2.0 compatibility -- could you please send me either exceptions or entire code so I'd try to debug it. Thanks, ilya > We've been encountering a lot of out-of-order problems with our use of > PySNMP 2.0.5, so we were planning to move to 3.3.4 today (which has, at > least in the examples, explicit checks for out-of-order messages), or > rewrite the 2.0.5 code to avoid the OOR problems. > > However, on installing 3.3.4, something seems wonky (that's a technical > term ;) ). I ran a few tests to see that the system was installed > correctly and got some surprising results. For instance, querying a > DOCSIS Cable Modem Termination System for the IP addresses of the > connected modems: > > 08:41:49 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py > 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3 > Traceback (most recent call last): > File "snmpwalk.py", line 132, in ? > raise str(rsp['pdu'].values()[0]['error_status']) + ' at '\ > ErrorStatus: 3 ((badValue) The value given has the wrong type or length) > at .1.3.6.1.2.1.10.127.1.3.3.1.3 > 08:43:29 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py > 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3.1 > .1.3.6.1.2.1.10.127.1.3.3.1.3.1 ---> '172.16.9.125' > 08:43:33 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py > 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3.2 > .1.3.6.1.2.1.10.127.1.3.3.1.3.2 ---> '172.16.6.38' > 08:46:06 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py > 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3.3 > .1.3.6.1.2.1.10.127.1.3.3.1.3.3 ---> '172.16.2.229' > 08:46:11 mcfletch@cmon:~/pysnmp-3.3.4/examples $ > > That is, snmpwalk seems to choke on the first response to the walk (the > one that's doing a GET instead of a GETNext (which has changed between > these two versions)), but is perfectly happy to get the sub-elements > manually (with the GET I would assume). The same error is returned for > doing an snmpget.py request on the table root. > > Other tables do appear to be traversed correctly... > > 09:03:33 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py > 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3 > .1.3.6.1.2.1.10.127.1.3.3.1.2.1 ---> '\x00\xe0o\x05@Q' > .1.3.6.1.2.1.10.127.1.3.3.1.2.2 ---> '\x00\xe0o\x04\x08\xaf' > .1.3.6.1.2.1.10.127.1.3.3.1.2.3 ---> '\x00\xe0o\x05\xc0\x7f' > .1.3.6.1.2.1.10.127.1.3.3.1.2.4 ---> '\x00\xe0o\x05@\xd3' > ... > > Now, I'll wind up rewriting the snmpwalk stuff anyway to fit into a > library module for our system, but I'm wondering whether that first > "get" request is really supposed to be there, and if so, what it's > supposed to be doing. If it's not really necessary I may just wrap a > try:except: around it to catch this case, but I'd like to know why it's > there before I start ignoring it. > > BTW, we weren't able to get our PySNMP 2.x code to work with the 3.x > compatability layer. Exceptions deep in the bowels of PySNMP kept > popping up. > > Ideas welcome, > Mike > > _______________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://members.rogers.com/mcfletch/ |
From: Mike C. F. <mcf...@ro...> - 2003-08-13 13:58:35
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> We've been encountering a lot of out-of-order problems with our use of PySNMP 2.0.5, so we were planning to move to 3.3.4 today (which has, at least in the examples, explicit checks for out-of-order messages), or rewrite the 2.0.5 code to avoid the OOR problems. However, on installing 3.3.4, something seems wonky (that's a technical term ;) ). I ran a few tests to see that the system was installed correctly and got some surprising results. For instance, querying a DOCSIS Cable Modem Termination System for the IP addresses of the connected modems: 08:41:49 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3 Traceback (most recent call last): File "snmpwalk.py", line 132, in ? raise str(rsp['pdu'].values()[0]['error_status']) + ' at '\ ErrorStatus: 3 ((badValue) The value given has the wrong type or length) at .1.3.6.1.2.1.10.127.1.3.3.1.3 08:43:29 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3.1 .1.3.6.1.2.1.10.127.1.3.3.1.3.1 ---> '172.16.9.125' 08:43:33 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3.2 .1.3.6.1.2.1.10.127.1.3.3.1.3.2 ---> '172.16.6.38' 08:46:06 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3.1.3.3 .1.3.6.1.2.1.10.127.1.3.3.1.3.3 ---> '172.16.2.229' 08:46:11 mcfletch@cmon:~/pysnmp-3.3.4/examples $ That is, snmpwalk seems to choke on the first response to the walk (the one that's doing a GET instead of a GETNext (which has changed between these two versions)), but is perfectly happy to get the sub-elements manually (with the GET I would assume). The same error is returned for doing an snmpget.py request on the table root. Other tables do appear to be traversed correctly... 09:03:33 mcfletch@cmon:~/pysnmp-3.3.4/examples $ python snmpwalk.py 172.16.0.1 public .1.3.6.1.2.1.10.127.1.3.3 .1.3.6.1.2.1.10.127.1.3.3.1.2.1 ---> '\x00\xe0o\x05@Q' .1.3.6.1.2.1.10.127.1.3.3.1.2.2 ---> '\x00\xe0o\x04\x08\xaf' .1.3.6.1.2.1.10.127.1.3.3.1.2.3 ---> '\x00\xe0o\x05\xc0\x7f' .1.3.6.1.2.1.10.127.1.3.3.1.2.4 ---> '\x00\xe0o\x05@\xd3' ... Now, I'll wind up rewriting the snmpwalk stuff anyway to fit into a library module for our system, but I'm wondering whether that first "get" request is really supposed to be there, and if so, what it's supposed to be doing. If it's not really necessary I may just wrap a try:except: around it to catch this case, but I'd like to know why it's there before I start ignoring it. BTW, we weren't able to get our PySNMP 2.x code to work with the 3.x compatability layer. Exceptions deep in the bowels of PySNMP kept popping up. Ideas welcome, Mike _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |
From: Ilya E. <il...@gl...> - 2003-08-04 11:19:43
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> My impression is that 3.x is stable enough. Let me know if you run into any problem with it. Thanks, ilya > > BTW, I suggest you trying pysnmp-3.x (its native API) instead of > > pysnmp-2.x as it's hopefully has a more clear design and > > implementation. > > Thanks for the reply. I wasn't sure about using the 3.x API because > it was marked experimental. Is the 3.x branch more or less stable? |
From: Pete K. <pet...@ka...> - 2003-08-04 11:03:22
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Ilya Etingof <il...@gl...> writes: > BTW, I suggest you trying pysnmp-3.x (its native API) instead of > pysnmp-2.x as it's hopefully has a more clear design and > implementation. Thanks for the reply. I wasn't sure about using the 3.x API because it was marked experimental. Is the 3.x branch more or less stable? Thanks again for your work on this project! Pete |
From: Ilya E. <il...@gl...> - 2003-08-04 08:29:12
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Pete, In fact both approaches should work exactly the same. The only difference is the point where you pass encoded oids&vals to trap object. > trap = v2c.TRAP() > encoded_oids = [] > encoded_vals = [] > [add the encoded oids and vals] > host.send(trap.encode(encoded_oids=encoded_oids, encoded_vals=encoded_vals)) So, what is the problem with the above? > This is what I first tried, but was never able to get working because > each time a trap was fired, the trap contained all of the varbinds > from the previous trap (i.e. they kept appending): > > def add_varbind(trap, oid, val): > trap['encoded_oids'].append(oid) > trap['encoded_vals'].append(val) > > trap = v2c.TRAP() > [add the encoded oids and vals using 'add_varbind(trap, oid, val)' function] > encoded_trap = trap.encode() > host.send(encoded_trap) > > This never worked; yet I am not sure why because I create myself a new > trap object each time a trap is fired and I stuff it with the > appropriate values. Clearly, I am using the API wrong. I searched > for a method to clear the object state (trap.clear() didn't work). That's probably because you're doing append() to var-bind list. Try assignment (=) instead. > My questions are: > > 1) Should I just abandon the second approach? Or am I just using the > API incorrectly in this case? I do not see much difference in these approaches. The bottom line is to have a single persistent trap object stuffed with new oids&vals on each trap. > 2) In both examples above, the 'host' object (created from > role.manager()) is created once in the lifetime of the program. Is > it safe to use this object multiple times for each trap that I > send? Yes, to the extent of slight performance penalty (objects and socket creation etc.). BTW, I suggest you trying pysnmp-3.x (its native API) instead of pysnmp-2.x as it's hopefully has a more clear design and implementation. Hope this helps, ilya |
From: Pete K. <pet...@ka...> - 2003-07-31 22:04:42
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Hi! First, thanks for writing this library! I can't tell you how much more I prefer using a pure python library than some wrapper around net-snmp! Now my question :-) I have a long running process that periodically fires v2c traps. Based on the examples and documentation, it appears that there are two ways of sending a trap. This is what I am doing now (it works): trap = v2c.TRAP() encoded_oids = [] encoded_vals = [] [add the encoded oids and vals] host.send(trap.encode(encoded_oids=encoded_oids, encoded_vals=encoded_vals)) This is what I first tried, but was never able to get working because each time a trap was fired, the trap contained all of the varbinds from the previous trap (i.e. they kept appending): def add_varbind(trap, oid, val): trap['encoded_oids'].append(oid) trap['encoded_vals'].append(val) trap = v2c.TRAP() [add the encoded oids and vals using 'add_varbind(trap, oid, val)' function] encoded_trap = trap.encode() host.send(encoded_trap) This never worked; yet I am not sure why because I create myself a new trap object each time a trap is fired and I stuff it with the appropriate values. Clearly, I am using the API wrong. I searched for a method to clear the object state (trap.clear() didn't work). My questions are: 1) Should I just abandon the second approach? Or am I just using the API incorrectly in this case? 2) In both examples above, the 'host' object (created from role.manager()) is created once in the lifetime of the program. Is it safe to use this object multiple times for each trap that I send? Thanks for the help! Please CC me directly as I am not a subscriber yet. Thanks, Pete |
From: Ilya E. <il...@gl...> - 2003-07-28 12:54:50
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Olav, Could it be due to your switch's response comes from the address/port different from that you queried? Could you snoop your request along with switch's response to [dis]prove that hypothesis? thanks, ilya |
From: Olav <ne...@st...> - 2003-07-28 12:35:42
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Ilya Etingof <il...@gl...>: > > Please, try the snmpwalk.py attached and let me know if it helps. > Hi again! I've tried the modified snmpwalk.py, but it still fails. I don't think the problem is snmpwalk.py anymore, but rather (I guess) role.py. The error is the same. Traceback (most recent call last): File "D:\pysnmp\examples\snmpwalk.py", line 135, in ? client.send_and_receive(req.encode(), (None, 0), cb_fun) File "d:\pysnmp\pysnmp\mapping\udp\role.py", line 180, in send_and_receive raise error.NoResponseError('No response arrived in %d secs * %d retries' % (self.timeout, self.retries)) pysnmp.mapping.udp.error.NoResponseError: No response arrived in 1 secs * 5 retries But when I do a trace, I can see that the response contains the data I'm looking for: Internet Protocol, Src Addr: 10.1.10.65 (10.1.10.65), Dst Addr: 10.1.0.10 (10.1.0.10) User Datagram Protocol, Src Port: 1041 (1041), Dst Port: snmp (161) Simple Network Management Protocol Version: 1 (0) Community: my_community!@sw1 PDU type: GET-NEXT (1) Request Id: 0x000001d4 Error Status: NO ERROR (0) Error Index: 0 Object identifier 1: 1.3.6.1.2.1.1.1 (SNMPv2-MIB::sysDescr) Value: NULL Frame 19 (187 bytes on wire, 187 bytes captured) Ethernet II, Src: 00:01:e7:db:83:00, Dst: 00:01:03:04:cb:2c Internet Protocol, Src Addr: 10.1.0.10 (10.1.0.10), Dst Addr: 10.1.10.65 (10.1.10.65) User Datagram Protocol, Src Port: 1507 (1507), Dst Port: 1041 (1041) Simple Network Management Protocol Version: 1 (0) Community: my_community!@sw1 PDU type: RESPONSE (2) Request Id: 0x000001d4 Error Status: NO ERROR (0) Error Index: 0 Object identifier 1: 1.3.6.1.2.1.1.1.0 (SNMPv2-MIB::sysDescr.0) Value: STRING: HP J4121A ProCurve Switch 4000M, revision C.09.09, ROM C.06.01 (/sw/code/build/vgro(c09)) Olav ------------------------------------------------------------ Få din egen @start.no-adresse gratis på http://www.start.no/ |
From: Ilya E. <il...@gl...> - 2003-07-25 13:55:39
|
Please, try the snmpwalk.py attached and let me know if it helps. > This happens b/c snmpwalk.py tries to get the first OID into search range > by means of a leading GET request followed by one or more GETNEXT's. It > appears to be dangerous (initial OID may not be accessible) so I'm > going to fix snmpwalk.py to behave in the same way as NetSNMP snmpwalk > does: > > - (snmpwalk.c): > - New ability to peform a get on the requested OID when either no > results are returned or when the user requests an inclusive > option. > > Hope to do that tomorrow. Will let you know then. > > > I have done a "packet trace" and the only difference I can spot is in the snmp > > section of the packet where snmpwalk.py produces this line: > > > > PDU type: GET (0) > > > > But two other snmpwalk utilities I have tried produce this line: > > > > PDU type: GET-NEXT (1) > > > > When I use snmpwalk.py I actually get a response. This is an error > > > > Error Status: NO SUCH NAME (2) > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > pysnmp-users mailing list > pys...@li... > https://lists.sourceforge.net/lists/listinfo/pysnmp-users > |
From: Ilya E. <il...@gl...> - 2003-07-24 19:16:16
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> This happens b/c snmpwalk.py tries to get the first OID into search range by means of a leading GET request followed by one or more GETNEXT's. It appears to be dangerous (initial OID may not be accessible) so I'm going to fix snmpwalk.py to behave in the same way as NetSNMP snmpwalk does: - (snmpwalk.c): - New ability to peform a get on the requested OID when either no results are returned or when the user requests an inclusive option. Hope to do that tomorrow. Will let you know then. > I have done a "packet trace" and the only difference I can spot is in the snmp > section of the packet where snmpwalk.py produces this line: > > PDU type: GET (0) > > But two other snmpwalk utilities I have tried produce this line: > > PDU type: GET-NEXT (1) > > When I use snmpwalk.py I actually get a response. This is an error > > Error Status: NO SUCH NAME (2) |
From: Ilya E. <il...@gl...> - 2003-07-24 12:40:03
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Could you snoop on the wire when querying switch stack members with GetIF to see what is the community name GetIF actually uses? The NoResponseError exception you get is likely to be caused by mismatched community name what makes your device to ignore your request. pysnmp code does not modify community name in any way. > I'm having trouble with snmpwalk when I try to access members in a switch > stack. To access stack members through the commander's IP address, I must > append @sw<switch number> to the community name. > My problem is that snmpwalk fails when I try to do as described above > > > This works - but reports only the commander. > > snmpwalk.py 10.1.0.10 my_community .1.3.6.1.2.1.17.4.3.1 > > When I try > > snmpwalk.py 10.1.0.10 my_community@sw1 .1.3.6.1.2.1.17.4.3.1 > > snmpwalk fails with: > Traceback (most recent call last): > File "D:\pysnmp\examples\snmpwalk.py", line 112, in ? > (answer, src) = client.send_and_receive(req.encode(), (None, 0), cb_fun) > File "d:\pysnmp\pysnmp\mapping\udp\role.py", line 180, in send_and_receive > raise error.NoResponseError('No response arrived in %d secs * %d retries' % > (self.timeout, self.retries)) > pysnmp.mapping.udp.error.NoResponseError: No response arrived in 1 secs * 5 > retries > > > It works with GetIF (a SNMP MIB Browser). |
From: Harry H. <ne...@st...> - 2003-07-24 12:18:55
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> Hi! I'm having trouble with snmpwalk when I try to access members in a switch stack. To access stack members through the commander's IP address, I must append @sw<switch number> to the community name. My problem is that snmpwalk fails when I try to do as described above This works - but reports only the commander. snmpwalk.py 10.1.0.10 my_community .1.3.6.1.2.1.17.4.3.1 When I try snmpwalk.py 10.1.0.10 my_community@sw1 .1.3.6.1.2.1.17.4.3.1 snmpwalk fails with: Traceback (most recent call last): File "D:\pysnmp\examples\snmpwalk.py", line 112, in ? (answer, src) = client.send_and_receive(req.encode(), (None, 0), cb_fun) File "d:\pysnmp\pysnmp\mapping\udp\role.py", line 180, in send_and_receive raise error.NoResponseError('No response arrived in %d secs * %d retries' % (self.timeout, self.retries)) pysnmp.mapping.udp.error.NoResponseError: No response arrived in 1 secs * 5 retries It works with GetIF (a SNMP MIB Browser). Any ideas anyone? regards Olav ------------------------------------------------------------ Få din egen @start.no-adresse gratis på http://www.start.no/ |
From: Ilya E. <il...@gl...> - 2003-05-26 05:12:40
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> PySNMP package does not implement MIB compiler at the moment so you have several options (in no particular order): * Use libsmi to dump MIBII into Python classes then bind the result with PySNMP for SNMP functionality * Use http://sf.net/projects/yapsnmp/ or http://sf.net/projects/snmpy/ both are wrappers over NetSNMP * Extract SMI data (OIDs, types) from MIBII and hardcode them into your Python script. This makes sense if you only deal with a small fraction of the MIB tree. On Sun, 25 May 2003, Arthur 8 wrote: > A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> > List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, > <mailto:pys...@li...?subject=unsubscribe> > List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> > Date: Mon, 26 May 2003 07:18:08 +0800 > > > I'm very new to SNMP and MIBs in general. Can someone point me to a > PySNMP program that reads from and writes to a MIB-II MIB? > > Thanks, > > Arthur > -- > _______________________________________________ > Get your free email from http://www.boardermail.com > > Powered by Outblaze > > > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application fit in a > relational database is painful, don't do it! Check out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > pysnmp-users mailing list > pys...@li... > https://lists.sourceforge.net/lists/listinfo/pysnmp-users > |
From: Arthur 8 <ar...@bo...> - 2003-05-25 23:18:17
|
A list for users of pure-Python SNMP framework <pysnmp-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pysnmp-users>, <mailto:pys...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=pysnmp-users> I'm very new to SNMP and MIBs in general. Can someone point me to a PySNMP program that reads from and writes to a MIB-II MIB? Thanks, Arthur -- _______________________________________________ Get your free email from http://www.boardermail.com Powered by Outblaze |