Comment 2 for bug 1541152

Revision history for this message
Joshua Powers (powersj) wrote :

It appears that .get takes a list.

On zesty:

root@zesty:~# python
Python 2.7.12+ (default, Nov 22 2016, 00:48:54)
[GCC 6.2.1 20161119] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netsnmp
>>> session = netsnmp.Session( DestHost='demo.snmplabs.com', Version=2, Community='public' )
>>> vars = netsnmp.Varbind('1.3.6.1.2.1.43.10.2.1.4.1.1')
>>> session.get(vars)
Segmentation fault (core dumped)

That said if I do it this way I avoid the core dump:

>>> vars = netsnmp.VarList( netsnmp.Varbind('1.3.6.1.2.1.43.10.2.1.4.1.1') )
>>> session.get(vars)
>>> error: get: unknown object ID (1.3.6.1.2.1.43.10.2.1.4.1.1)

Which is a lot better :)