Re: [pysnmp-users] Notification Originator example fails (pysnmp 4.2.5 / Python 3.4)
Brought to you by:
elie
From: Ilya E. <il...@gl...> - 2015-02-19 10:40:49
|
Hello Marat, That’s likely a bug. Could you please try the latest pysnmp (which works just fine to me with your code): https://sourceforge.net/projects/pysnmp/files/pysnmp/4.2.6/ and alert me in case of further issues? -ilya > On 19 Feb 2015, at 12:51, Марат Рысбеков <mar...@gm...> wrote: > > Hello, > > I would like to use pysnmp 4.2.5 (installed via pip) to send SNMP traps. I tried running the following example (taken from http://pysnmp.sourceforge.net/examples/current/v3arch/oneliner/agent/ntforg/trap-v2c-with-mib-lookup.py <http://pysnmp.sourceforge.net/examples/current/v3arch/oneliner/agent/ntforg/trap-v2c-with-mib-lookup.py>): > > --- > from pysnmp.entity.rfc3413.oneliner import ntforg > > ntfOrg = ntforg.NotificationOriginator() > > errorIndication = ntfOrg.sendNotification( > ntforg.CommunityData('public'), > ntforg.UdpTransportTarget(('localhost', 162)), > 'trap', > ntforg.MibVariable('SNMPv2-MIB', 'coldStart'), > ( ntforg.MibVariable('SNMPv2-MIB', 'sysName', 0), 'new name' ) > ) > > if errorIndication: > print('Notification not sent: %s' % errorIndication) > --- > > When I run it with Python 3.4.2 I get this: > > --- > Exception ignored in: <bound method AsynNotificationOriginator.__del__ of <pysnmp.entity.rfc3413.oneliner.ntforg.AsynNotificationOriginator object at 0x7fd0a07a4978>> > Traceback (most recent call last): > File "/usr/local/lib/python3.4/site-packages/pysnmp/entity/rfc3413/oneliner/ntforg.py", line 33, in __del__ > def __del__(self): self.uncfgNtfOrg() > File "/usr/local/lib/python3.4/site-packages/pysnmp/entity/rfc3413/oneliner/ntforg.py", line 100, in uncfgNtfOrg > for authDataKey in authDataKeys: > RuntimeError: dictionary changed size during iteration > --- > > With Python 2.7.8 the example works just fine. > > Is the example not applicable to pysnmp 4.2.5 / Python 3.4? > > Best regards, > Marat Rysbekov > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk_______________________________________________ > pysnmp-users mailing list > pys...@li... > https://lists.sourceforge.net/lists/listinfo/pysnmp-users |