pySNMP: SNMPget example

WIWA wim_wauters at
Thu Jul 10 13:56:27 CEST 2003

I have recently installed pySNMP 3.3.2 and use Python 2.2.2. Thanks to
Peter Hansen, I succeeded to install pySNMP properly. I'm not
completely new to SNMP (I know the basics), but I'm new to Python and
pysnmp. While experimenting, I find some strange things. When using

1) I can type: 'import pysnmp' or 'from pysnmp import *'

2) when using: 'from pysnmp import role' (found on
.net/examples/2.x/snmpget.html), I get the message 'ImportError:
import name role'. The same applies for 'from pysnmp import session'
or 'from pysnmp import v1' , but 'from pysnmp import proto' seems to

3) A general question: how can I get a list of what I can type after
the 'from
pysnmp import ...'

4) How can I use: 'from snmpget import snmpget'. It does not accept

5) Anyone has a simple example for the following application: I have a
modem (which has an SNMP agent inside). I want to make a script where
I can
do SNMPgets (and later SNMPSet and SNMPwalk). 

6) Where can I find a simple description on how to use 'snmpget'. I
cannot find
anything. I would like to write sth like snmpget(IP, OID)

7) What is the difference between snmpget and getrequest in pysnmp? 

Any input is appreciated...

Thanks in advance,


More information about the Python-list mailing list