segmentation fault when calling session.get() method
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
net-snmp (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
I was hoping to use this python module to get retrieve a single OID from a networked copy machine.
So I fired up ipython and did:
import netsnmp
session = netsnmp.
# this produces quite a bit of output, I'll try and include it later.
vars = netsnmp.
session.get(vars)
Segmentation fault (core dumped)
I've tried this on a VM running 32 bit ubuntu and a laptop running 64 bit ubuntu. (both running 14.04) same results.
Even if I'm misusing the API (which is possible, I've never used the netsnmp python bindings before) I really don't think this should produce a segfault.
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python-netsnmp 5.7.2~dfsg-
ProcVersionSign
Uname: Linux 3.13.0-74-generic i686
NonfreeKernelMo
ApportVersion: 2.14.1-0ubuntu3.19
Architecture: i386
CurrentDesktop: Unity
Date: Tue Feb 2 18:42:29 2016
SourcePackage: net-snmp
UpgradeStatus: No upgrade log present (probably fresh install)
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 :)