pysnmp.sourceforge.net
HOME QUICK START DOCUMENTATION EXAMPLES DOWNLOAD
DEVELOPMENT | CONTACT |

High-level SNMP

Command Generator
Notification Originator

SNMP with Asyncore

Command Generator
Command Responder
Notification Originator
Notification Receiver
Command Forwarder

SNMP with Asyncio

Command Generator
Command Responder
Notification Originator
Notification Receiver

SNMP with Trollius

Command Generator
Notification Originator

SNMP with Twisted

Command Generator
Command Responder
Notification Originator
Notification Receiver

Packet-level SNMP

Command Generator
Command Responder
Notification Originator
Notification Receiver

WARNING: you are reading historical documentation! Please, refer here.

Hungarian translation
Romanian translation
Belarussian translation

PySNMP example scripts

SNMP is not really simple (PySNMP implementation takes 15K lines of Python code), but PySNMP tries to isolate the complexities and let you perform typical SNMP operations in a quick and intuitive way.

PySNMP offers three groups of programming interfaces to deal with SNMP protocol. In the order from most consice to most detailed those APIs are:

Before doing cut&paste of the code below into your Python interpreter, make sure to install pysnmp and its dependencies by running pip or easy_install:

# pip pysnmp

There's a public SNMP responder configured at demo.snmplabs.com:161 to let you run PySNMP examples scripts in a cut&paste fashion. If you wish to use your own SNMP Agent with these scripts, make sure to either configure your local snmpd and/or snmptrapd or use a valid address and SNMP credentials of your SNMP Agent in the examples to let them work.

If you find your PySNMP application behaving unexpectedly, try to enable a /more or less verbose/ built-in PySNMP debugging by adding the following snippet of code at the beginning of your application:

from pysnmp import debug

# use specific flags or 'all' for full debugging
debug.setLogger(debug.Debug('dsp', 'msgproc', 'secmode'))

Then run your app and watch stderr. The Debug initializer enables debugging for a particular PySNMP subsystem, 'all' enables full debugging. More specific flags are 'io', 'dsp', 'msgproc', 'secmod', 'mibbuild', 'mibview', 'mibinstrum', 'acl', 'proxy', 'app'.

For more details on PySNMP programming model and interfaces, please refer to the documentation.


Need help? Try PySNMP mailing lists or report to library maintainers.
SourceForge Logo