error with netsnmp.snmpwalk in libsnmp-python

Bug #966552 reported by D Zhang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Here's the python code:

import netsnmp
oid = netsnmp.Varbind('sysDescr')
result = netsnmp.snmpwalk(oid, Version = 2, DestHost="localhost", Community="public")

and, here's the output
[L:root@net-monitor] /opt/ip-mgmt# python test.py
error: walk: unknown python error (varlist)#

also,

[L:root@net-monitor] /opt/ip-mgmt# python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netsnmp
>>> oid = netsnmp.Varbind('sysDescr')
>>> result = netsnmp.snmpwalk(oid, Version = 2, DestHost="localhost", Community="public")
error: walk: unknown python error (varlist)>>>
TypeError: expected string or Unicode object, NoneType found

(I pressed enter and TypeError line occured)

and,

[L:root@net-monitor] /opt/ip-mgmt# snmpwalk -v2c -c public localhost sysDescr
SNMPv2-MIB::sysDescr.0 = STRING: Linux net-monitor 2.6.32-37-server #81-Ubuntu SMP Fri Dec 2 20:49:12 UTC 2011 x86_64

So SNMP works.

System: Lucid amd64, with the most current packages.

Revision history for this message
D Zhang (cheungtifan) wrote :

Package: libsnmp-python
New: yes
State: installed
Automatically installed: no
Version: 5.4.2.1~dfsg0ubuntu1-0ubuntu2.1
Priority: optional
Section: universe/python
Maintainer: Ubuntu Core Developers <email address hidden>
Uncompressed Size: 1057k
Depends: python (< 2.7), python (>= 2.6), python-central (>= 0.6.11), libc6 (>= 2.4), libsnmp15 (>= 5.4.2.1~dfsg)
Description: SNMP (Simple Network Management Protocol) Python support
 The Simple Network Management Protocol (SNMP) provides a framework for the exchange of management information between agents (servers) and clients.

 The Net-SNMP Python support files provide the Python functions for integration of SNMP into applications written in Python.
Homepage: http://net-snmp.sourceforge.net/

This is the version.

Revision history for this message
D Zhang (cheungtifan) wrote :

I tested on 5.4.3~dfsg-2.2ubuntu1, and the bug disappeared on this release.

Changed in net-snmp (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.