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 :)
It appears that .get takes a list.
On zesty:
root@zesty:~# python 'demo.snmplabs. com', Version=2, Community='public' ) Varbind( '1.3.6. 1.2.1.43. 10.2.1. 4.1.1')
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=
>>> vars = netsnmp.
>>> 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') ) 1.2.1.43. 10.2.1. 4.1.1)
>>> session.get(vars)
>>> error: get: unknown object ID (1.3.6.
Which is a lot better :)