pysnmp-dev Mailing List for SNMP library for Python (Page 10)
Brought to you by:
elie
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(6) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
(3) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(3) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(1) |
Feb
(1) |
Mar
(5) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
(3) |
Nov
(1) |
Dec
|
2010 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(4) |
Nov
(8) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(9) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(2) |
Dec
(2) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
(2) |
Jun
(3) |
Jul
|
Aug
(2) |
Sep
(3) |
Oct
(3) |
Nov
(4) |
Dec
|
2015 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
(20) |
Oct
(18) |
Nov
(5) |
Dec
|
2021 |
Jan
(5) |
Feb
(11) |
Mar
(19) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2022 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(4) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Mark M E. <mar...@ma...> - 2007-08-14 22:21:33
|
I've run into a couple of issues that I think are bugs in the oneliner implementation. I'm still learning my way around PySNMP, so apologies if my assumptions or conclusions are incorrect. Issue #1: Oneliner commands "leaking" sockets. UdpTransportTarget.openClientMode() creates a transport via UdpSocketTransport(). A side effect of using the default parameters is that a new channel/socket is created and is registered in asyncore.socket_map. The socket is never removed from asyncore.socket_map, it's never garbage collected and the socket is never closed. The result is that instantiating and destroying large numbers of CommandGenerators will consume all of the systems socket resources. I have a patch that works for me which is to pass a throw away dictionary as the sockMap. Example: pysnmp/entity/rfc3413/oneliner/cmdgen.py: class UdpTransportTarget: ... def openClientMode(self): self.transport = udp.UdpSocketTransport(sock=None, sockMap= {}).openClientMode() return self.transport Issue #2: CommandGenerator().nextCmd() does not work with V1 devices. V1 devices terminate the list list of OIDs by returning an errorStatus of noSuchName(2), not by returning a value of endOfMib. CommandGenerator().nextCmd() considers a non-false errorStatus as an error (makes sense) and passes that failure to the caller. I've hacked my local version to explicitly check for an errorStatus of 2, and clears that errorStatus/Index. This seems to work, but there may be a cleaner solution. pysnmp/entity/rfc3413/oneliner/cmdgen.py: class CommandGenerator(AsynCommandGenerator): ... def nextCmd(self, authData, transportTarget, *varNames): def __cbFun( sendRequestHandle, errorIndication, errorStatus, errorIndex, varBindTable, (varBindHead, varBindTotalTable, appReturn) ): if errorStatus == 2: # V1 terminates GETNEXT with an errorStatus of noSuchName # rather than a value of endOfMib (which v2c.PDUAPI replaces # with None). errorStatus = errorStatus.clone(0) errorIndex = errorIndex.clone(0) pass if errorIndication or errorStatus: ... Hopefully this information is helpful. Regards, Mark |
From: Ilya E. <il...@gl...> - 2006-12-24 22:43:13
|
> I see that you have "Disallow SNMP access to USM objects" on your TODO > list. My organization will be using these objects to create new users > remotely. If your TODO item means just that you will change the access > level of the objects in SNMP-USER-BASED-SM-MIB to "noaccess", that's > fine, because we can easily change the access levels. If it means > something more than that, hopefully you'll reconsider. I was also Perhaps what I meant in the TODO list is to set up a default negative view to disallow USM subtree access at Agent by Manager. Whenever user deliberately needs remote LCD access s/he would be free to change that default VACM setting. So, you're on a safe side. ;) > hoping you'd implement the algorithm that creates the encryption and > authentication keys from the usmUserAuthKeyChange and > usmUserPrivKeyChange values. Yeah, right, let me figure out how it's supposed to be done... > I have written a patch for SNMP-USER-BASED-SM-MIB.py that gives the > usmUserSecurityName object the value of usmUserName whenever the is > changed. The patch is on the website. Please consider incorporating it; > it will save your newer users some hassle should they try to create > users remotely. I've put a comment on it at the website. I'll try to re-work your patch in a more reliable way as well... Thanks, ilya |
From: Brian K. <kyc...@sp...> - 2006-12-21 20:20:36
|
Ilya, I see that you have "Disallow SNMP access to USM objects" on your TODO list. My organization will be using these objects to create new users remotely. If your TODO item means just that you will change the access level of the objects in SNMP-USER-BASED-SM-MIB to "noaccess", that's fine, because we can easily change the access levels. If it means something more than that, hopefully you'll reconsider. I was also hoping you'd implement the algorithm that creates the encryption and authentication keys from the usmUserAuthKeyChange and usmUserPrivKeyChange values. I have written a patch for SNMP-USER-BASED-SM-MIB.py that gives the usmUserSecurityName object the value of usmUserName whenever the is changed. The patch is on the website. Please consider incorporating it; it will save your newer users some hassle should they try to create users remotely. Brian |
From: Ilya E. <il...@gl...> - 2006-12-20 23:30:37
|
> One leak i think is coming from lines 158 and 159 in > pysnmp/v4/smi/indices.py . I can't be sure of this for certain but Fixed in CVS. Please, let me know should you encounter any issues with this fix. -ilya |
From: Ilya E. <il...@gl...> - 2006-12-20 20:50:36
|
> I am seeing significant memory leaks when using pysnmp (sf cvs > checkout from this morning) in a long running deamon. Is anyone else > seeing any issues with this ? Yeah, there could be leaks in SNMPv3 code... Could you give me a hint how do I reproduce your setup to see where these leaks could be? > One leak i think is coming from lines 158 and 159 in > pysnmp/v4/smi/indices.py . I can't be sure of this for certain but > another pair of eyes looking at this would be good. This isn't the > only leak though as it doesn't cure my overal problem. >From the first glance this may cause a cyclic reference... Let me try to fix that in CVS. Will let you know then. > Are there any known memory leaks in the code that i could look into > and possibly fix. I'm not aware of any unfixed ones. -ilya |
From: Adam G. <a.g...@cs...> - 2006-12-20 20:14:38
|
Hi I am seeing significant memory leaks when using pysnmp (sf cvs checkout from this morning) in a long running deamon. Is anyone else seeing any issues with this ? One leak i think is coming from lines 158 and 159 in pysnmp/v4/smi/indices.py . I can't be sure of this for certain but another pair of eyes looking at this would be good. This isn't the only leak though as it doesn't cure my overal problem. Are there any known memory leaks in the code that i could look into and possibly fix. many thanks adam |
From: Olivier <oc...@ma...> - 2005-12-16 18:03:16
|
On Fri, 2005-16-12 at 20:51 +0300, Ilya Etingof wrote: > Pardon me for replying that late. I hope to be faster from now on. >=20 > At first, I do not see that end-of-mib condition detection is totally > broken in bulkwalk app. I'm now trying to bulkwalk several OIDs within a > single request so the whole walk stops at some point. >=20 > There *is* a [hopefully] minor misfeature with current code that shows up > when you walk multiple OIDs within a single request. In that case bulkwal= k > stops whenever all of those OIDs reach EOM condition. If one of them hits > EOM prior to other, the dead one would still be reported to an app but wi= th > value part set to None (what could be filtered out at the app level). >=20 > Is this what you observe? Please, clarify what exactly fails and in what > way. >=20 > Speaking of design of this part of pysnmp API, maybe it would be better t= o > simplify this redundant None-as-EOM-flag protocol in favor of leaving > original error object as is in var-binding value. Whenever App notices > an endOfMib (or other v2c error objects) in value part of var-binding, Ap= p > may stop walking. Although, this approach would impose certain difficult= ies > on SNMPv1 PDU processing as there is no error objects in var-binding... >=20 > Anyway, I'd have to know more about the problem you've reported to figure > out what's going wrong. When I run ... from pysnmp.entity.rfc3413.oneliner import cmdgen cmdgen.CommandGenerator().bulkCmd(...)=20 It goes into an infinite loop inside pysnmp because it seems to never detect the endObMib problem anywhere.. The agent is net-snmp based.. and the net-snmp tools detect the endofmib correctly.=20 But I dont care too much anymore, I ended up switching to Perl and the net-snmp perl module because its much much faster.. pysnmp takes 2-3 seconds at 100% cpu on a Xeon 3.6ghz to parse snmp data while its barely noticeable with the netsnmp code. > On Wed, 7 Dec 2005, Olivier [ISO-8859-1] Cr?te wrote: >=20 > > Hi, > > > > I've been trying to use pysnmp to write a manager app that fetches some > > data from an snmp agent (built with net-snmp) and pushes it into a DB.. > > > > But, pysnmp using BulkCommandGenerator does not stop properly when it > > receives a endOfMib. The tools from net-snmp do. Maybe its because its > > returned as a success and not an error? Anyways, it should stop there. > > > > --=20 Olivier Cr=C3=AAte oc...@ma... Maximum Throughput Inc. |
From: Ilya E. <il...@gl...> - 2005-12-16 17:51:38
|
Pardon me for replying that late. I hope to be faster from now on. At first, I do not see that end-of-mib condition detection is totally broken in bulkwalk app. I'm now trying to bulkwalk several OIDs within a single request so the whole walk stops at some point. There *is* a [hopefully] minor misfeature with current code that shows up when you walk multiple OIDs within a single request. In that case bulkwalk stops whenever all of those OIDs reach EOM condition. If one of them hits EOM prior to other, the dead one would still be reported to an app but with value part set to None (what could be filtered out at the app level). Is this what you observe? Please, clarify what exactly fails and in what way. Speaking of design of this part of pysnmp API, maybe it would be better to simplify this redundant None-as-EOM-flag protocol in favor of leaving original error object as is in var-binding value. Whenever App notices an endOfMib (or other v2c error objects) in value part of var-binding, App may stop walking. Although, this approach would impose certain difficulties on SNMPv1 PDU processing as there is no error objects in var-binding... Anyway, I'd have to know more about the problem you've reported to figure out what's going wrong. Thanks, ilya On Wed, 7 Dec 2005, Olivier [ISO-8859-1] Cr?te wrote: > Hi, > > I've been trying to use pysnmp to write a manager app that fetches some > data from an snmp agent (built with net-snmp) and pushes it into a DB.. > > But, pysnmp using BulkCommandGenerator does not stop properly when it > receives a endOfMib. The tools from net-snmp do. Maybe its because its > returned as a success and not an error? Anyways, it should stop there. > > |
From: Olivier <oc...@ma...> - 2005-12-07 21:34:07
|
Hi, I've been trying to use pysnmp to write a manager app that fetches some data from an snmp agent (built with net-snmp) and pushes it into a DB..=20 But, pysnmp using BulkCommandGenerator does not stop properly when it receives a endOfMib. The tools from net-snmp do. Maybe its because its returned as a success and not an error? Anyways, it should stop there. --=20 Olivier Cr=C3=AAte oc...@ma... Maximum Throughput Inc. |
From: Ilya E. <il...@gl...> - 2005-11-30 18:53:59
|
> 1. I want to communicate with a v2c node. So, you have got a SMIv2-compliant Agent available via SNMPv2c protocol? > 2. I want to access the enterprise MIB to get the oid given the oidname This is certainly possible. > 3. I then what to set singleton parameters and create and delete table > entries Are you going to manage SNMP table at some distant SNMP Agent with your pysnmp-based SNMP manager? I guess you can do that then. > I have looked at the manager scripts in the v1 and v3arch folders. From > what I understand in order to access the MIBs I need to use pySNMP > v3arch. Is this true? If I got you correctly, it's feasible with both v1 and v2 arch of pysnmp. Though, the v3arch has a very-high-level API what would make it much more easer for you work with. > These scripts send the requests to 'local host' - I assume this can be > replaced by the ip address of the remote node. Is this true? That's true. You may want to read pysnmp tutorial (for pysnmp-4.x) http://pysnmp.sourceforge.net/docs/4.1.x/index.html and experiment with pysnmpset tool from pysnmp-apps package. -ilya |
From: Ilya E. <il...@gl...> - 2005-11-30 18:06:06
|
> Do these only apply to v3 arch - I see there is an > examples\v3arch\oneliner directory but no examples\v1arch\oneliner > directory? As of this writing, there's no very-high-level API (AKA one-liner) to SNMPv1/v2c architecture. Though, it is planned for implementation. > However the scripts in examples\v1arch\manager are 'Command generator > application' scripts according to the comments in the script. That's right. In pysnmp, there are several API layers -- there is a low-level one, which follows SNMP architecture as specified in RFCs. The others are more high-level and pythonic. These examples\v1arch\ scripts are written over the highest-level API currently available for SNMPv1/v2c arch (which is high-level API to SNMP message objects). > I want to use a v2c compliant script to create table entries in a node > that is v3 compliant. I'm not quite certain what your aim is. Are you going to manage some SNMPv3-complient SNMP agent with SNMPv2c SNMP manager? Please, clarify. In fact, SNMPv2c & SNMPv3 uses the same SMI model which is SMIv2. The bottom line is that with SNMPv3 architecture of pysnmp (pysnmp-4.x) you could talk to SNMP engine of any architecture, as there is an internal SNMP proxy inside SNMPv3 arch of pysnmp doing protocol & SMI translations behind the scene. -ilya |
From: O'Leary Rosemary-r. <Rosemary.O'<Le...@mo...> - 2005-11-29 09:55:55
|
Hi, First time user (and mailer)! 1. I want to communicate with a v2c node. 2. I want to access the enterprise MIB to get the oid given the oidname 3. I then what to set singleton parameters and create and delete table entries I have looked at the manager scripts in the v1 and v3arch folders. From what I understand in order to access the MIBs I need to use pySNMP v3arch. Is this true? These scripts send the requests to 'local host' - I assume this can be replaced by the ip address of the remote node. Is this true? rgds, Rosemary |
From: O'Leary Rosemary-r. <Rosemary.O'<Le...@mo...> - 2005-11-28 14:42:48
|
Do these only apply to v3 arch - I see there is an examples\v3arch\oneliner directory but no examples\v1arch\oneliner directory? However the scripts in examples\v1arch\manager are 'Command generator application' scripts according to the comments in the script. I want to use a v2c compliant script to create table entries in a node that is v3 compliant. This is actually a prototype - when deployed it will be invoked via a menu option in an product that is v2c compliant. rgds, Rosemary |
From: Ilya E. <il...@gl...> - 2004-11-30 10:46:48
|
Could you please send me the repr() of raw response message your script generates while polling that device. Having smth like: print repr(rawrsp) would be a useful hint. Are you using the same SNMP version (v2c) when polling with AdnentNet browser? Also, to rule out a bug in your device code -- try adding '.0' to your OID e.g. '1.3.6.1.4.1.5655.4.1.6.3.0'. -ilya > I am trying to use the pysnmp with the basic operation of GETREQUEST from a > network device that support SNMP and I responded with "noSuchInstance" > although this specific OID has value and it can be seen by "AdnentNet" Snmp > browser, the code I am using is: > > from pysnmp import role, v2c, asn1 > > ###################################################################### > req = v2c.GETREQUEST() > tr = role.manager(('10.1.12.85', 161)) > (rawrsp, src) = tr.send_and_receive( \ > req.encode(community='guy', \ > encoded_oids=map(asn1.OBJECTID().encode,[ > '1.3.6.1.4.1.5655.4.1.6.3']))) > rsp = v2c.RESPONSE() > rsp.decode(rawrsp) > oids = map(lambda x:x[0], map(asn1.OBJECTID().decode, rsp['encoded_oids'])) > print oids > vals = map(lambda x: x[0](), map(asn1.decode, rsp['encoded_vals'])) > print map(asn1.decode, rsp['encoded_vals']) > print vals > > ###################################################################### > > and the output I recieve is: > > ########################################### > > ['.1.3.6.1.4.1.5655.4.1.6.3'] > [(noSuchInstance(''), '')] > [''] > > ########################################### |
From: Guy M. <gu...@p-...> - 2004-11-30 09:28:58
|
Hi, I am trying to use the pysnmp with the basic operation of GETREQUEST from a network device that support SNMP and I responded with "noSuchInstance" although this specific OID has value and it can be seen by "AdnentNet" Snmp browser, the code I am using is: from pysnmp import role, v2c, asn1 ###################################################################### req = v2c.GETREQUEST() tr = role.manager(('10.1.12.85', 161)) (rawrsp, src) = tr.send_and_receive( \ req.encode(community='guy', \ encoded_oids=map(asn1.OBJECTID().encode,[ '1.3.6.1.4.1.5655.4.1.6.3']))) rsp = v2c.RESPONSE() rsp.decode(rawrsp) oids = map(lambda x:x[0], map(asn1.OBJECTID().decode, rsp['encoded_oids'])) print oids vals = map(lambda x: x[0](), map(asn1.decode, rsp['encoded_vals'])) print map(asn1.decode, rsp['encoded_vals']) print vals ###################################################################### and the output I recieve is: ########################################### ['.1.3.6.1.4.1.5655.4.1.6.3'] [(noSuchInstance(''), '')] [''] ########################################### Appreciate your help Guy. |
From: Ilya E. <il...@gl...> - 2004-11-26 12:41:47
|
> >pysnmp is written from scratch and is a pure-python implementation. > > > Cool. Does that mean it is slower or is it much of a muchness ?? Definitely, current versions are several times slower. Although, chances are the next release would be somewhat faster due to [asn1/ber] code re-design... -ilya |
From: Brendan S. <Bre...@fa...> - 2004-11-26 12:04:11
|
Ilya Etingof wrote: > Yes, I'm working on v3 support. The general framework of SNMPv3 > >architecture has been implemented (in pysnmp-4.x), so what's left >is basically SNMPv3 message processing and user-based security model. > >It's not really a lot of work but I need maybe a month of relatively free >time to put my hand on it.... > > Fingers crossed that you do get plenty of time ;-) >pysnmp is written from scratch and is a pure-python implementation. > > Cool. Does that mean it is slower or is it much of a muchness ?? Brendan Simon. |
From: Ilya E. <il...@gl...> - 2004-11-26 07:14:11
|
> I'm a newbie to pysnmp. I have never used it (yet)? > I am looking for a way write an SNMP manager that supports the v3 > security model. There's no SNMPv3 support at pysnmp at the moment. > I have looked at YapSnmp but v3 isn't supported yet. I've emailed the > maintainer a number of times and he says that it shouldn't be too hard > to do but time has passed by and still no v3 :( > > I saw on this list that v3 could also be supported soon. Is anybody > working on it? If so when is it expected to be available? Yes, I'm working on v3 support. The general framework of SNMPv3 architecture has been implemented (in pysnmp-4.x), so what's left is basically SNMPv3 message processing and user-based security model. It's not really a lot of work but I need maybe a month of relatively free time to put my hand on it.... > I think YapSnmp is a wrapper to net-snmp. Is PySnmp the same or is it > written from scratch?? pysnmp is written from scratch and is a pure-python implementation. -ilya |
From: Brendan S. <Bre...@fa...> - 2004-11-26 06:55:57
|
Hi all, I'm a newbie to pysnmp. I have never used it (yet)? I am looking for a way write an SNMP manager that supports the v3 security model. I have looked at YapSnmp but v3 isn't supported yet. I've emailed the maintainer a number of times and he says that it shouldn't be too hard to do but time has passed by and still no v3 :( I saw on this list that v3 could also be supported soon. Is anybody working on it? If so when is it expected to be available? I think YapSnmp is a wrapper to net-snmp. Is PySnmp the same or is it written from scratch?? Ta, Brendan Simon. |
From: Ilya E. <il...@gl...> - 2004-03-17 09:38:35
|
The SET operation is very similar to the GET one. That's why I've not included an example on SET into the distribution. But since this seems to be a confusing point, I'm going to add a SET example into the distro. Meanwhile, I've put it up on the web: http://pysnmp.sourceforge.net/examples/3.4.x/manager/setgen.html Please, let me know if anything still remains unclear. -ilya On Tue, 16 Mar 2004, Gregory Gee wrote: > There seems to be lots of examples, but I was wondering if > someone has an example of doing an SNMPSET using 3.4.2? I > just downloaded pySNMP for the first time and followed the > example in the README with no problems. > > A small example of setting 1 or 2 variables with a synchronous > send and receive. > > Thanks, > Greg > > [root@snoopy root]# python > Python 2.2.2 (#1, Feb 24 2003, 19:13:11) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from pysnmp.proto import v1 > >>> from pysnmp.proto.api import generic > >>> from pysnmp.mapping.udp import role > >>> req = v1.GetRequest() > >>> req.apiGenGetPdu().apiGenSetVarBind([('1.3.6.1.2.1.1.1.0', v1.Null())]) > >>> tr = role.manager(('192.168.10.1',161)) > >>> (answer, src) = tr.send_and_receive(req.encode()) > >>> rsp = v1.GetResponse() > >>> rsp.decode(answer) > '' > >>> vars = rsp.apiGenGetPdu().apiGenGetVarBind() > >>> print vars > [('.1.3.6.1.2.1.1.1.0', OctetString('Instant Internet version 7.20'))] > >>> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Pysnmp-dev mailing list > Pys...@li... > https://lists.sourceforge.net/lists/listinfo/pysnmp-dev > |
From: Gregory G. <gr...@sy...> - 2004-03-16 22:40:22
|
There seems to be lots of examples, but I was wondering if someone has an example of doing an SNMPSET using 3.4.2? I just downloaded pySNMP for the first time and followed the example in the README with no problems. A small example of setting 1 or 2 variables with a synchronous send and receive. Thanks, Greg [root@snoopy root]# python Python 2.2.2 (#1, Feb 24 2003, 19:13:11) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from pysnmp.proto import v1 >>> from pysnmp.proto.api import generic >>> from pysnmp.mapping.udp import role >>> req = v1.GetRequest() >>> req.apiGenGetPdu().apiGenSetVarBind([('1.3.6.1.2.1.1.1.0', v1.Null())]) >>> tr = role.manager(('192.168.10.1',161)) >>> (answer, src) = tr.send_and_receive(req.encode()) >>> rsp = v1.GetResponse() >>> rsp.decode(answer) '' >>> vars = rsp.apiGenGetPdu().apiGenGetVarBind() >>> print vars [('.1.3.6.1.2.1.1.1.0', OctetString('Instant Internet version 7.20'))] >>> |
From: Ilya E. <il...@gl...> - 2003-09-04 08:10:46
|
Please, send me the command line that is not being accepted by the tool so I'd try to pinpoint syntax error there. Also, keep in mind that the trap feature is somewhat different in versions 1 and 2c of SNMP protocol, so snmptrap parameters greatly depend of SNMP version being used. > I am unable to run the "snmptrap.py" module ..any help would be highly > appreciated . I tried all the command line options correctly .. but > seems that it doesn't accept the input parameters .Always giving some > syntax erros.Anyone who tried this and able to send Trap successfully to > an agent ? if yes please let me know the command line parameters which > were used . |
From: Santosh K. K <san...@da...> - 2003-09-04 07:06:07
|
Hi all, I am unable to run the "snmptrap.py" module ..any help would be highly appreciated . I tried all the command line options correctly .. but seems that it doesn't accept the input parameters .Always giving some syntax erros.Anyone who tried this and able to send Trap successfully to an agent ? if yes please let me know the command line parameters which were used . Thanks, Santosh |
From: Ilya E. <il...@gl...> - 2002-09-20 07:25:58
|
Once again, sorry for delaying so much. I've tried to decode a few of the octet-streams you refer to so they all seem to have the same problem of malformed variables-bindings in PDU: >>>v1.decode('0^\002\001\000\004\006public\244Q\006\011+\006\001\004\001\203\004\001\010@\004\202\327\250\007\002\001\006\002\001fC\003\004\344]0301\006\015+\006\001\004\001\203\004\001\010\001\001\004\000\004\006\000\240\370\241\277\3610\030\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X\326zj=\003\307\000\000\212\000\000\000\212\000\000\000\000\006[\312\226D\000\340{\212\012\013\010\000E\000\000|\002\230\000\000>\021\003\013\202\327\250\007\202\327\311\030\005\217\000\242\000h\373\230') Traceback (innermost last): File "<stdin>", line 1, in ? File "v1.py", line 843, in decode rest = msg.decode(input) File "v1.py", line 590, in decode if self.bindings.decode(self.pdu['bindings']): File "v1.py", line 192, in decode return self._decode(input) File "v1.py", line 369, in _decode raise TypeError('Trailing garbage in binding: %s' % repr(binding)) v1.TypeError: Trailing garbage in binding: '0\030\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X' >>>asn1.decode('0\030\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X''0\030\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X') (SEQUENCE('\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X'), '0\030\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X') >>>asn1.decode('0\030\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X') (SEQUENCE('\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X'), '') >>>asn1.decode('\006\016+\006\001\004\001\203\004\001\010\002\010\004\001\002\004\006\000\240\370\217}X') (OBJECTID('.1.3.6.1.4.1.388.1.8.2.8.4.1.2'), '\004\006\000\240\370\217}X') >>> asn1.decode('\004\006\000\240\370\217}X') (OCTETSTRING('\000\240\370\217}X'), '') >>> So, this looks like this trap message produced by your device has *two* variables-bindings with a single var-bind in each instead of a single variables-bindings with two subsequent var-binds. The first var-bind carries the .1.3.6.1.4.1.388.1.8.1.1.4.0 OID and value (not shown above) while the second has .1.3.6.1.4.1.388.1.8.2.8.4.1.2 OID and value (see above). This structure seems to be invalid according to RFC1157 (only one variables-bindings structure is allowed in PDU) so that's why pysnmp can't decode it. A more relaxed approach would be to ignore the second variables-bindings in PDU (does ethereal work this way?). This can be easily implemented by subclassing and tweaking v1.BINDINGS() decode method. Please, let me know if you need any assistance on this. -ilya >From: Frank Sweetser <fes@us...> >Subject: Valid packets undecodable by pysnmp >Date: 2002-08-26 12:16 > > I've got a device (specifically, a Symbol 4131 wireless access >point) that > I'm trying to manage via pysnmp. The AP is sending out traps that >pysnmp > seems to barf on, but ethereal declares perfectly valid. > > Help! > > I've put a sample of the offending traps up at > http://erwin.wpi.edu/~fs/4131.cap |
From: Ilya E. <il...@gl...> - 2002-09-20 06:34:49
|
Let me beg your pardon for not replying earlier -- I appeared not to be subscribed on this list. So, both are typos. I've just fixed them at CVS and going to release pysnmp-2.0.6. Thanks, ilya >From: Abhinay Sharma <abhinay@go...> >Subject: Are these typos ? >Date: 2002-06-19 17:55 > > Hi, > I wanted to move from pysnmp v1.x to v2.x. I notice > the following things which seem to me to be errors. > > These are files obtained from pysnmp-2.0.1.tar > > File bulkrole.py > > Line 15: class error(role.error): > """Base class for bulkrole module > """ > pass > Should role.error be role.Error ? > > > Line 205: except error.SNMPEngineError: > pass > > There is no SNMPEngineError in error.py ? > > > Fixing them on my copy makes things happy. Just wanted > to know if its indeed broken or I am missing something. > > Thanks. |