Re: Set on hex string using python library

2009-08-06 Thread François Dumont
I don't know if you're talking about a get or set request. To be clear, and for other people who would like to do so, I give you both get and set requests for a MAC address with snmp python library that I'm using : GET : > oid = netsnmp.Varbind('rbAuBaseStationId', '1') >

RE: Set on hex string using python library

2009-08-05 Thread Mike Ayers
> From: François Dumont [mailto:[email protected]] > Sent: Wednesday, August 05, 2009 5:56 AM > Oh yes, sorry, I used "%02s". With "%02X", it's really good ! So wouldn't 'BA:BE:00:00:FA:CE' also have worked? HTH, Mike -

Re: Set on hex string using python library

2009-08-05 Thread François Dumont
Oh yes, sorry, I used "%02s". With "%02X", it's really good ! Thank you. 2009/8/5 Vincent Bernat > > On Wed, 5 Aug 2009 12:47:20 +0100, François Dumont > wrote: > > Ok, it works. > > > > The result is 186:190:186:190:250:206. Would it be possible to have the > > same > > result in hexadecimal

Re: Set on hex string using python library

2009-08-05 Thread Vincent Bernat
On Wed, 5 Aug 2009 12:47:20 +0100, François Dumont wrote: > Ok, it works. > > The result is 186:190:186:190:250:206. Would it be possible to have the > same > result in hexadecimal ? If not, I can go with that. It should be hexadecimal. Didn't you use "%02d" instead of "%02x"? >> >> On Wed, 5

Re: Set on hex string using python library

2009-08-05 Thread François Dumont
Ok, it works. The result is 186:190:186:190:250:206. Would it be possible to have the same result in hexadecimal ? If not, I can go with that. Thank you 2009/8/5 Vincent Bernat > > On Wed, 5 Aug 2009 10:13:41 +0100, François Dumont > wrote: > > > I tried ":".join("%02x" % ord(a) for a in Hard

Re: Set on hex string using python library

2009-08-05 Thread Vincent Bernat
On Wed, 5 Aug 2009 10:13:41 +0100, François Dumont wrote: > I tried ":".join("%02x" % ord(a) for a in HardwareAddress) but I got the > error "ord() expected a character, but string of length 6 found". Yes, try: ":".join("%02x" % ord(a) for a in HardwareAddress[0]) I missed the fact that you g

Re: Set on hex string using python library

2009-08-05 Thread François Dumont
Hi, I tried ":".join("%02x" % ord(a) for a in HardwareAddress) but I got the error "ord() expected a character, but string of length 6 found". Any idea ? Thank you 2009/8/4 Vincent Bernat > OoO Lors de la soirée naissante du mardi 04 août 2009, vers 18:47, > François Dumont disait : >

Re: Set on hex string using python library

2009-08-04 Thread Vincent Bernat
OoO Lors de la soirée naissante du mardi 04 août 2009, vers 18:47, François Dumont disait : > oid = netsnmp.Varbind('rbAuBaseStationId', '1') > HardwareAddress = netsnmp.snmpget(oid, DestHost = RadioID, Community = > "public", Version = 2) > print HardwareAddress > But it'

Re: Set on hex string using python library

2009-08-04 Thread François Dumont
2009/8/4 Dave Shield > > I've logged this as a bug in the project tracker (#2832044) > > Dave > Thank you. I have another question : about the display of a MAC address (still using the python library). When I do this query : oid = netsnmp.Varbind('rbAuBaseStationId', '1') > HardwareAddress = n

Re: Set on hex string using python library

2009-08-04 Thread Dave Shield
2009/8/4 François Dumont : > Ok, I have found why it didn't work. I've looked the packets with wireshark, > and the problem was that the python script only sent BA BE, and not the rest > (00 00 FA CE). So I tried to put something else than 00, like 01 01 FA CE, > or BA BE FA CE, and it works. So it

Re: Set on hex string using python library

2009-08-04 Thread François Dumont
Ok, I have found why it didn't work. I've looked the packets with wireshark, and the problem was that the python script only sent BA BE, and not the rest (00 00 FA CE). So I tried to put something else than 00, like 01 01 FA CE, or BA BE FA CE, and it works. So it seems that the agent doesn't like

Re: Set on hex string using python library

2009-08-04 Thread Dave Shield
2009/8/4 François Dumont : > In fact, I cannot restart the agent with options. I can only push the reset > button to restart the agent. Then I'm afraid I cannot help you any further. Unless you can get hold of a packet dump of the (failing) python-based request, to compare against the (working) c

Re: Set on hex string using python library

2009-08-04 Thread François Dumont
In fact, I cannot restart the agent with options. I can only push the reset button to restart the agent. 2009/8/4 Dave Shield > 2009/8/4 François Dumont : > > I tried an snmpset without the -f option, which is not defined in the > > available option. > > No - I said to restart the *agent* using

Re: Set on hex string using python library

2009-08-04 Thread Dave Shield
2009/8/4 François Dumont : > I tried an snmpset without the -f option, which is not defined in the > available option. No - I said to restart the *agent* using the options -f -Le -d You've got two client commands - one that works (snmpset) and one that doesn't (using python). The task now is to

Re: Set on hex string using python library

2009-08-04 Thread François Dumont
I tried an snmpset without the -f option, which is not defined in the available option. snmpset -Le -d -c private -v 2c 10.0.0.1 1.3.6.1.4.1.12394.1.2.7.2.1.3.0 x > 'ba be 00 00 fa ce'(sorry, wrote '\xba\xbe\x00\x00\xfa\xce' in last > message, but it's with spaces instead of \x) > Here is the

Re: Set on hex string using python library

2009-08-04 Thread François Dumont
I have found the numeric OID of this object : 1.3.6.1.4.1.12394.1.2.7.2.1.3.0 So I tried this : oid = netsnmp.Varbind('1.3.6.1.4.1.12394.1.2.7.2.1.3', '0', > '\xba\xbe\x00\x00\xfa\xce') > rbAuConfiguredBaseStationId = netsnmp.snmpset(oid, DestHost = "10.0.0.1", > Community = "private", Version =

Re: Set on hex string using python library

2009-08-04 Thread Dave Shield
2009/8/4 François Dumont : > Yes, it works with an snmpset (in command line) on that OID > >> snmpset -c private -v 2c 10.0.0.1 1.3.6.1.4.1.12394.1.2.7.2.1.3.0 x >> '\xba\xbe\x00\x00\xfa\xce' Try restarting the agent using the options -f -Le -d (plus anything else that you normally use), a

Re: Set on hex string using python library

2009-08-04 Thread François Dumont
Yes, it works with an snmpset (in command line) on that OID snmpset -c private -v 2c 10.0.0.1 1.3.6.1.4.1.12394.1.2.7.2.1.3.0 x > '\xba\xbe\x00\x00\xfa\xce' > 2009/8/4 Dave Shield > 2009/8/4 François Dumont : > > I have found the numeric OID of this object : > > 1.3.6.1.4.1.12394.1.2.7.2.1.3.0

Re: Set on hex string using python library

2009-08-04 Thread Dave Shield
2009/8/4 François Dumont : > I have found the numeric OID of this object : > 1.3.6.1.4.1.12394.1.2.7.2.1.3.0 [snip] > And it still doesn't work. The result of the set is 0, the hex string > doesn't change. Does it work if you run "snmpset" on that OID? (with the same community string) Dave

Re: Set on hex string using python library

2009-08-04 Thread Dave Shield
2009/8/4 François Dumont : > I tried '\xba\xbe\x00\x00\xfa\xce' but it didn't work. I can confirm that this syntax does indeed send the required value. So the problem must lie elsewhere. One thing I spotted: >> >     oid = netsnmp.Varbind('rbAuConfiguredBaseStationId', '1',. The python scri

Re: Set on hex string using python library

2009-08-04 Thread François Dumont
Hi, I tried '\xba\xbe\x00\x00\xfa\xce' but it didn't work. I tried everything : with uppercase/lowercase characters, with '\xba\xbe\x00\x00\xfa\xce', with '\xba:\xbe:\x00:\x00:\xfa:\xce', with 'ba be 00 00 fa ce' with '\xba \xbe \x00 \x00 \xfa \xce', nothing works. Thank you 2009/7/31 Vincent Be

Re: Set on hex string using python library

2009-07-31 Thread Vincent Bernat
OoO Pendant le temps de midi du vendredi 31 juillet 2009, vers 12:49, François Dumont disait : > import netsnmp > oid = netsnmp.Varbind('rbAuConfiguredBaseStationId', '1', 'ba be 00 00 fa > ce') > rbAuConfiguredBaseStationId = netsnmp.snmpset(oid, DestHost = "10.0.0.1", >