Bug in python bindings
Nikola Đurak <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <CANJKVojn5xSBrAJLLkTiNuAWcf2noSgz8tPg-tyEOgrX3n=dLQ@mail.gmail.com> |
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 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