Re: Bug in python bindings
Bill Fenner <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <CAF4SogZ_gEGB=VkhZ6cq16DFO0-sQ_ASu_3RWkKqqBt9-SSmTQ@mail.gmail.com> |
On Fri, Jul 12, 2013 at 10:04 AM, Nikola Đurak <[email protected]>wrote: > Bug description: > Values sent on the wire with netsnmp.snmpset function are not the values > set in the code. > > Version: > aptitude show libsnmp-python > Package: libsnmp-python > State: installed > Automatically installed: no > Version: 5.4.3~dfsg-2.4ubuntu1 > Priority: optional > Section: universe/python > Maintainer: Ubuntu Core Developers <[email protected]> > Architecture: i386 > Uncompressed Size: 164 k > Depends: python2.7, python (>= 2.7.1-0ubuntu2), python (< 2.8), libc6 (>= > 2.4), libsnmp15 (>= 5.4.3~dfsg) > > > > How to reproduce: c/p in python shell > import netsnmp > atmVclEntry = '.1.3.6.1.2.1.37.1.7.1.' > rx=145 > tx=130 > var = [ > netsnmp.Varbind(atmVclEntry + '6.1610670080.4294967295.4294967295', > val=rx+1, type='INTEGER'), > netsnmp.Varbind(atmVclEntry + '7.1610670080.4294967295.4294967295', > val=tx+1, type='INTEGER'), > netsnmp.Varbind(atmVclEntry + '14.1610670080.4294967295.4294967295', > val=1, type='INTEGER'), > netsnmp.Varbind(atmVclEntry + '15.1610670080.4294967295.4294967295', > val=1, type='INTEGER'), > netsnmp.Varbind(atmVclEntry + '13.1610670080.4294967295.4294967295', > val=4, type='INTEGER') > ] > rez = netsnmp.snmpset(*var, Version=2, DestHost='10.100.10.254', > Community='private', Timeout=5000000, Retries=1) > > values on the wire > .1.3.6.1.2.1.37.1.7.1.6.1610670080.4294967295.4294967295 = 146 > .1.3.6.1.2.1.37.1.7.1.7.1610670080.4294967295.4294967295 = 131 > .1.3.6.1.2.1.37.1.7.1.14.1610670080.4294967295.4294967295 = 131 <- string > 31 from the previous varbind is appended > .1.3.6.1.2.1.37.1.7.1.15.1610670080.4294967295.4294967295 = 131 <- string > 31 from the previous varbind is appended > .1.3.6.1.2.1.37.1.7.1.13.1610670080.4294967295.4294967295 = 431 <- string > 31 from the previous varbind is appended > > > Workaround: set values in varbinds like this > var = [ > netsnmp.Varbind(atmVclEntry + '6.1610670080.4294967295.4294967295', > val=rx+1, type='INTEGER'), > netsnmp.Varbind(atmVclEntry + '7.1610670080.4294967295.4294967295', > val=tx+1, type='INTEGER'), > netsnmp.Varbind(atmVclEntry + '14.1610670080.4294967295.4294967295', > val='001', type='INTEGER'), > netsnmp.Varbind(atmVclEntry + '15.1610670080.4294967295.4294967295', > val='001', type='INTEGER'), > netsnmp.Varbind(atmVclEntry + '13.1610670080.4294967295.4294967295', > val='004', type='INTEGER') > ] > I don't know when it changed, but in net-snmp 5.7.2 running your original code results in the desired values on the wire: 37.1.7.1.6.1610670080.4294967295.4294967295=146 37.1.7.1.7.1610670080.4294967295.4294967295=131 37.1.7.1.14.1610670080.4294967295.4294967295=1 37.1.7.1.15.1610670080.4294967295.4294967295=1 37.1.7.1.13.1610670080.4294967295.4294967295=4 Bill > > > > > I don't now if this bug is reported, and I'm not interested in bug fixing > (I'll use my workaround), I just wanted to help. > > Regards > > > > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > Net-snmp-users mailing list > [email protected] > Please see the following page to unsubscribe or change other options: > https://lists.sourceforge.net/lists/listinfo/net-snmp-users > > ------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users