Compare commits

..

8 Commits

Author SHA1 Message Date
Ilya Etingof 34d19a7e77 fixed zero boots/time values put into SNMPv3 TRAP 2018-04-21 17:14:07 +02:00
Ilya Etingof 1021d56e1b better InetAddressType rendering fix 2018-04-21 17:11:54 +02:00
Ilya Etingof c419576445 fix InetAddressType rendering 2018-04-19 01:10:24 +02:00
Ilya Etingof dff00bf90f Use old Sphinx with old Python 2018-04-13 09:36:19 +02:00
Ilya Etingof bec02e6fc1 Include LICENSE in wheel 2018-04-13 08:57:55 +02:00
Ilya Etingof 6aed418b86 4.4.5 2018-04-09 11:56:57 +02:00
Ilya Etingof 4b21d3da29 typo fix in RFC1158::snmpOutReadOnlys 2018-04-09 11:55:20 +02:00
Ilya Etingof 194d2ec820 pysnmp-apps renamed into snmpclitools 2018-04-09 11:52:11 +02:00
335 changed files with 3194 additions and 7748 deletions

6
.gitignore vendored
View File

@ -23,9 +23,3 @@ docs/source/.templates/layout.html
# Virtual envs
venv*
# Tox
.tox/
# Pyenv
.python-version

View File

@ -1,41 +1,19 @@
language: python
cache: pip
matrix:
include:
- os: linux
dist: xenial
sudo: false
python: '2.7'
- os: linux
dist: xenial
sudo: false
python: '3.4'
- os: linux
dist: xenial
sudo: false
python: '3.5'
- os: linux
dist: xenial
sudo: false
python: '3.6'
- os: linux
dist: xenial
sudo: true
python: '3.7'
- os: linux
dist: xenial
sudo: false
python: 'nightly'
# - os: linux
# dist: xenial
# sudo: false
# python: 'pypy'
# - os: linux
# dist: xenial
# sudo: false
# python: 'pypy3'
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "nightly"
# - "pypy"
# - "pypy3"
install:
- pip install -r requirements.txt -r devel-requirements.txt -r extra-requirements.txt
- pip install -r requirements.txt -r devel-requirements.txt
- pip install -e .
- pip install pysnmp-mibs
script:
- travis_wait 20 sh runtests.sh
- sh runtests.sh

View File

@ -1,103 +1,10 @@
Revision 5.0.0, released 2018-10-??
Revision 4.4.5, released 2018-04-XX
-----------------------------------
- SNMPv3 crypto operations that require external dependencies
made dependent on the optional external
package -- pysnmpcrypto.
- By switching to pysnmpcrypto, pysnmp effectively migrates from
PyCryptodomex to pyca/cryptography whenever available on the
platform.
- Many really old backward-compatibility code snippets removed.
Most importantly:
* `pysnmp.entity.rfc3413.oneliner` and everything related
to the (non-standard) UNIX domain socket transport is gone
* `pysnmp.carrier.asynsock` backward-compatible wrapper over
`pysnmp.carrier.asyncore` is gone
- The MIB instrumentation API overhauled in backward incompatible
way:
* MIB instrumentation methods signatures simplified to accept
just var-binds (as var-arg), the rest of the parameters packed
into opaque kwargs
* The `readVars`, `readNextVars` and `writeVars` methods of MIB
instrumentation controller return immediately and deliver their
results via a call back.
* CommandResponder application passes `snmpEngine` and optionally
user-supplied `cbCtx` object throughout the MIB instrumentation
methods. The goal is to let MIB objects access/modify whatever
custom Python objects they need while being called back.
* CommandResponder refactored to facilitate asynchronous
MIB instrumentation routines.
- The high-level API (`hlapi`) extended to cover lightweight SNMP v1arch
in hope to ease the use of packet-level SNMP API.
By way of introducing v1arch hlapi, the sub-packages layout changed
so that `pysnmp.hlapi` is moved to `pysnmp.hlapi.v3arch` and the new
v1arch layer is introduced in `pysnmp.hlapi.v1arch`. This change does
not break backward compatibility as `pysnmp.hlapi` still defaults to
`pysnmp.hlapi.v3arch`.
The `pysnmp.hlapi.v1arch` is designed to be as much similar in use
to `pysnmp.hlapi.v3arch`, but with high-performance in mind. One of
the consequences of this higher performance focus is that various
automation around building well-formed SNMP messages is and mediating
differences between SNMP versions is not present in this new `v1arch`
layer.
- The signature of the hlapi `.sendNotification()` call has changed
to accept `*varBinds` instead of a sequence of `varBinds`. The rationale
is to unify this method call with similar methods of CommandGenerator.
This change should not compromise backward compatibility with pysnmp 4.
Revision 4.4.7, released 2018-11-XX
-----------------------------------
- Exposed ASN.1 `Null` type through `rfc1902` module for convenience.
- Use `compile()` before `exec`'ing MIB modules to attach filename to
the stack frames (ultimately shown in traceback/debugger)
- Fixed hlapi/v3arch transport target caching to ensure transport targets
are different even if just timeout/retries options differ
- Fixed hlapi LCD configurator to include `contextName`. Prior to this fix
sending SNMPv3 TRAP with non-default `contextName` would fail.
Revision 4.4.6, released 2018-09-13
-----------------------------------
- Improved package build and dependency tracking
- Fixed missing LICENSE from the tarball distribution
- Fixed `CommandGeneratorLcdConfigurator.unconfigure()` to fully clean up
internal caches, otherwise repetitive attempts to configure the target
would fail.
- Fix to tolerate possible duplicate enumerations in `Bits` and `Integer`
SMI types.
- Fix to tolerate non-initialised entries in SNMP community table. Once a
bad entry sneaked into the SNMP community table, all the subsequent
SNMP v1/v2c operations failed. The fix ignores incomplete SNMP community
table entries in the course of building indices.
Revision 4.4.5, released 2018-08-05
-----------------------------------
- Added PySnmpError.cause attribute holding parent exception tuple
- Fixed zero SNMPv3 boots/time values put in SNMPv3 TRAP messages
- Fixed broken InetAddressType rendering caused by a pyasn1 regression
- Fixed typo in RFC1158 module
- Fixed possible infinite loop in GETBULK response PDU builder
- Fixed memory leak in the `config.delContext()` VACM management harness
- Fixed `Bits` class initialization when enumeration values are given
- Fixed crash caused by incoming SNMPv3 message requesting SNMPv1/v2c
security model
- Fixed out-of-scope OIDs leaking at the end of SNMP table at hlapi
`nextCmd` and `bulkCmd` calls when `lexicographicMode = False`
Revision 4.4.4, released 2018-01-03
-----------------------------------
@ -657,7 +564,7 @@ Revision 4.2.4, released 2013-01-30
defaulted value changed from None to () meaning no var-binds.
- Attempt to convert Windows style EOL into UNIX ones in MIB source
modules appeared to be unnecessary and even destructive to modules
data in some cases. So the conversion code removed altogether.
data in some cases. So the convertion code removed altogether.
- Fix to isAccessAllowed() error handling at NotificationOriginator. System
used to crash on access denied condition.
- Fix to NotificationOriginator to make it use system uptime and trap OID
@ -918,7 +825,7 @@ Revision 4.1.16a, released 2011-03-17
configuration (LCD).
+ default debug.logger is now just a zero value instead of an object
what saves big on frequent calls
+ SNMPv2-SMI columnar indices <-> index values conversion code optimized.
+ SNMPv2-SMI columnar indices <-> index values convertion code optimized.
+ pre-compute and re-use some of ASN.1 structures.
+ avoid setting PDU defaults to save on unnecessary initialization.
+ skip ASN.1 types verification where possible.
@ -1108,7 +1015,7 @@ Revision 4.1.9a, released 2007-11-28
effects.
- Fix to rfc2576.v1ToV2c() PDU converter to perform noSuchName error code
translation.
- Fixes to Notification PDU conversion code at rfc2576 in part of
- Fixes to Notification PDU convertion code at rfc2576 in part of
snmpTrapOID handling.
- Fix to nonRepeaters object use as sequence slicer (must be int) at
cmdrsp.CommandResponderApplication
@ -1130,7 +1037,7 @@ Revision 4.1.8a, released 2007-08-14
------------------------------------
- UNSTABLE ALPHA RELEASE.
- SMI/dispatcher timeout conversion multiplier is actually 100 (1/100 sec)
- SMI/dispatcher timeout convertion multiplier is actually 100 (1/100 sec)
rather than 1/1000. This fix affects timeouts specified through SMI.
- __repr__() implemented for UdpTransportTarget, CommunityData, UsmUserData
in oneliner module.
@ -1181,7 +1088,7 @@ Revision 4.1.7a, released 2007-02-19
- Fix to MibViewController.getNodeName() to take MIB module name
into account (SF bug #1505847).
- Do explicit check for Counter32,Unsigned32,TimeTicks,Counter64 value types
in MibTableRow index conversion and in TextualConvention.prettyPrint()
in MibTableRow index convertion and in TextualConvention.prettyPrint()
methods (SF bug #1506341). Handle Bits in indices as RFC2578 suggests.
- Apply read-create column status to libsmi2pysnmp-generated code
whenever MIB text specifies that (SF bug #1508955).
@ -1205,7 +1112,7 @@ Revision 4.1.7a, released 2007-02-19
- LCD unconfiguration functions for oneliners implemented (SF bug #1635270).
- unloadModules() and unexportSymbols() implemented at MibBuilder
- Notification type PDU proxy code fixed to produce symmetrical
conversion.
convertion.
- Various SNMP engine-internal caches expiration implemented.
- SMI-level access control now takes effect only if AC object is
passed to MIB instrumentation API.

View File

@ -1,4 +1,4 @@
include *.rst *.txt *.md *.sh
include *.txt *.md *.sh
recursive-include examples *.py
recursive-include docs/source *.rst *.svg *.py
recursive-include docs/mibs *.txt

View File

@ -1,10 +1,10 @@
SNMP library for Python
-----------------------
[![PyPI](https://img.shields.io/pypi/v/pysnmp.svg?maxAge=2592000)](https://pypi.org/project/pysnmp/)
[![Python Versions](https://img.shields.io/pypi/pyversions/pysnmp.svg)](https://pypi.org/project/pysnmp/)
[![PyPI](https://img.shields.io/pypi/v/pysnmp.svg?maxAge=2592000)](https://pypi.python.org/pypi/pysnmp)
[![Python Versions](https://img.shields.io/pypi/pyversions/pysnmp.svg)](https://pypi.python.org/pypi/pysnmp/)
[![Build status](https://travis-ci.org/etingof/pysnmp.svg?branch=master)](https://secure.travis-ci.org/etingof/pysnmp)
[![GitHub license](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/etingof/pysnmp/master/LICENSE.rst)
[![GitHub license](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/etingof/pysnmp/master/LICENSE.txt)
This is a pure-Python, open source and free implementation of v1/v2c/v3
SNMP engine distributed under 2-clause [BSD license](http://snmplabs.com/pysnmp/license.html).
@ -27,7 +27,7 @@ Features
* [PySMI](http://snmplabs.com/pysmi/) integration for dynamic MIB compilation
* Built-in instrumentation exposing protocol engine operations
* Python eggs and py2exe friendly
* 100% Python, works with Python 2.4 though 3.7
* 100% Python, works with Python 2.4 though 3.6
* MT-safe (if SnmpEngine is thread-local)
Features, specific to SNMPv3 model include:
@ -44,7 +44,7 @@ Features, specific to SNMPv3 model include:
Download & Install
------------------
The PySNMP software is freely available for download from [PyPI](https://pypi.org/project/pysnmp/)
The PySNMP software is freely available for download from [PyPI](https://pypi.python.org/pypi/pysnmp)
and [GitHub](https://github.com/etingof/pysnmp.git).
Just run:
@ -56,9 +56,8 @@ $ pip install pysnmp
to download and install PySNMP along with its dependencies:
* [PyASN1](http://snmplabs.com/pyasn1/)
* [PyCryptodomex](https://pycryptodome.readthedocs.io) (required only if SNMPv3 encryption is in use)
* [PySMI](http://snmplabs.com/pysmi/) (required for MIB services only)
* Optional [pysnmpcrypto](https://github.com/etingof/pysnmpcrypto) package
whenever strong SNMPv3 encryption is desired
Besides the library, command-line [SNMP utilities](https://github.com/etingof/snmpclitools)
written in pure-Python could be installed via:

View File

@ -30,6 +30,5 @@ Laurelin of Middle Earth
Robert Reese
Olivier Verriest
Eugene M. Kim
Matt Bullock
Thanks to Python Software Foundation for granting financial support
for the project.

View File

@ -1,2 +1,4 @@
Sphinx <= 1.6; python_version < '2.7'
Sphinx > 1.6; python_version >= '2.7'
twisted
trollius; python_version < '3.0'

View File

@ -17,14 +17,14 @@ multilingual capabilities, remote configuration and other features.
PySNMP implementation closely follows intricate system details and features
bringing most possible power and flexibility to its users.
Current PySNMP stable version is 4.4. It runs with Python 2.4 through 3.7
Current PySNMP stable version is 4.4. It runs with Python 2.4 through 3.6
and is recommended for new applications as well as for migration from
older, now obsolete, PySNMP releases. All site documentation and
examples are written for the 4.4 and later versions in mind.
Older materials are still available under the obsolete section.
Besides the libraries, a set of pure-Python
`command-line tools <https://pypi.org/project/snmpclitools/>`_
`command-line tools <https://pypi.python.org/pypi/snmpclitools/>`_
are shipped along with the system. Those tools mimic the interface
and behaviour of popular Net-SNMP snmpget/snmpset/snmpwalk utilities.
They may be useful in a cross-platform situations as well as a testing

View File

@ -93,7 +93,7 @@ sponsoring it. Please get back to us to discuss details.
Contributions to the PySNMP source code is greatly appreciated as well.
We require contributed code to run with Python 2.4 through the latest
Python version (which is 3.7 at the time of this writing). Contributed
Python version (which is 3.6 at the time of this writing). Contributed
code will be redistributed under the terms of the same
`license <http://snmplabs.com/pysnmp/>`_ as PySNMP is.

View File

@ -3,40 +3,44 @@ Library reference
=================
.. toctree::
:maxdepth: 3
:maxdepth: 2
Dealing with many SNMP features may quickly overwhelm developers who aim at a
quick and trivial task, PySNMP employs a layered architecture approach
where the topmost programming API tries to be as simple as possible
to allow immediate solutions for most common use cases.
It will let you perform SNMP GET/SET/WALK and TRAP/INFORM operations by
pasting code snippets from PySNMP documentation and example scripts
right into your Python interactive session.
Most of SNMP operations involve packet exchange over network. PySNMP
is shipped with a set of bindings to popular asynchronous Python I/O
frameworks that let you run PySNMP in parallel with other tasks your
application may perform.
High-level, v3arch, sync
------------------------
Synchronous SNMP
----------------
The synchronous `hlapi.v3arch` API is the easiest to use and probably
the richest in features. However `hlapi.v1arch` API may be faster.
Most simple and strightforward way to use PySNMP is by employing its
Synchronous, blocking API. It's also the default API offered by
users on *pysnmp.hlapi* sub-package import.
Command Generator
.. toctree::
:maxdepth: 2
/docs/hlapi/v3arch/asyncore/sync/manager/cmdgen/getcmd
/docs/hlapi/v3arch/asyncore/sync/manager/cmdgen/setcmd
/docs/hlapi/v3arch/asyncore/sync/manager/cmdgen/nextcmd
/docs/hlapi/v3arch/asyncore/sync/manager/cmdgen/bulkcmd
/docs/hlapi/asyncore/sync/manager/cmdgen/getcmd
/docs/hlapi/asyncore/sync/manager/cmdgen/setcmd
/docs/hlapi/asyncore/sync/manager/cmdgen/nextcmd
/docs/hlapi/asyncore/sync/manager/cmdgen/bulkcmd
Notification Originator
.. toctree::
:maxdepth: 2
/docs/hlapi/v3arch/asyncore/sync/agent/ntforg/notification
/docs/hlapi/asyncore/sync/agent/ntforg/notification
Transport configuration
+++++++++++++++++++++++
@ -49,14 +53,14 @@ saves its configuration for the lifetime of SNMP engine object.
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v3arch.UdpTransportTarget
.. autoclass:: pysnmp.hlapi.UdpTransportTarget
:members: setLocalAddress
.. autoclass:: pysnmp.hlapi.v3arch.Udp6TransportTarget
.. autoclass:: pysnmp.hlapi.Udp6TransportTarget
:members: setLocalAddress
High-level v3arch asyncore
--------------------------
Asynchronous: asyncore
----------------------
The :mod:`asyncore` module is in Python standard library since ancient
times. Main loop is built around :mod:`select` dispatcher, user
@ -67,17 +71,17 @@ Command Generator
.. toctree::
:maxdepth: 2
/docs/hlapi/v3arch/asyncore/manager/cmdgen/getcmd
/docs/hlapi/v3arch/asyncore/manager/cmdgen/setcmd
/docs/hlapi/v3arch/asyncore/manager/cmdgen/nextcmd
/docs/hlapi/v3arch/asyncore/manager/cmdgen/bulkcmd
/docs/hlapi/asyncore/manager/cmdgen/getcmd
/docs/hlapi/asyncore/manager/cmdgen/setcmd
/docs/hlapi/asyncore/manager/cmdgen/nextcmd
/docs/hlapi/asyncore/manager/cmdgen/bulkcmd
Notification Originator
.. toctree::
:maxdepth: 2
/docs/hlapi/v3arch/asyncore/agent/ntforg/notification
/docs/hlapi/asyncore/agent/ntforg/notification
Transport configuration
+++++++++++++++++++++++
@ -85,14 +89,14 @@ Transport configuration
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v3arch.asyncore.UdpTransportTarget
.. autoclass:: pysnmp.hlapi.asyncore.UdpTransportTarget
:members: setLocalAddress
.. autoclass:: pysnmp.hlapi.v3arch.asyncore.Udp6TransportTarget
.. autoclass:: pysnmp.hlapi.asyncore.Udp6TransportTarget
:members: setLocalAddress
High-level v3arch asyncio
-------------------------
Asynchronous: asyncio
---------------------
The :mod:`asyncio` module first appeared in standard library since
Python 3.3 (in provisional basis). Its main design feature is that
@ -104,17 +108,17 @@ Command Generator
.. toctree::
:maxdepth: 2
/docs/hlapi/v3arch/asyncio/manager/cmdgen/getcmd
/docs/hlapi/v3arch/asyncio/manager/cmdgen/setcmd
/docs/hlapi/v3arch/asyncio/manager/cmdgen/nextcmd
/docs/hlapi/v3arch/asyncio/manager/cmdgen/bulkcmd
/docs/hlapi/asyncio/manager/cmdgen/getcmd
/docs/hlapi/asyncio/manager/cmdgen/setcmd
/docs/hlapi/asyncio/manager/cmdgen/nextcmd
/docs/hlapi/asyncio/manager/cmdgen/bulkcmd
Notification Originator
.. toctree::
:maxdepth: 2
/docs/hlapi/v3arch/asyncio/agent/ntforg/notification
/docs/hlapi/asyncio/agent/ntforg/notification
Transport configuration
+++++++++++++++++++++++
@ -122,14 +126,14 @@ Transport configuration
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v3arch.asyncio.UdpTransportTarget
.. autoclass:: pysnmp.hlapi.asyncio.UdpTransportTarget
:members: setLocalAddress
.. autoclass:: pysnmp.hlapi.v3arch.asyncio.Udp6TransportTarget
.. autoclass:: pysnmp.hlapi.asyncio.Udp6TransportTarget
:members: setLocalAddress
High-level v3arch trollius
--------------------------
Asynchronous: trollius
----------------------
An almost compatible alternative to *asyncio* for pre-3.3 Python
is `Trollius <http://trollius.readthedocs.org>`_ module. PySNMP's
@ -138,8 +142,8 @@ is `Trollius <http://trollius.readthedocs.org>`_ module. PySNMP's
Please refer to :doc:`Trollius examples </examples/contents>` for
more information.
High-level v3arch twisted
-------------------------
Asynchronous: Twisted
---------------------
`Twisted <http://twistedmatrix.org>`_ is one of the earliest and hugely
popular asynchronous I/O framework. It introduced a concept of
@ -152,17 +156,17 @@ Command Generator
.. toctree::
:maxdepth: 2
/docs/hlapi/v3arch/twisted/manager/cmdgen/getcmd
/docs/hlapi/v3arch/twisted/manager/cmdgen/setcmd
/docs/hlapi/v3arch/twisted/manager/cmdgen/nextcmd
/docs/hlapi/v3arch/twisted/manager/cmdgen/bulkcmd
/docs/hlapi/twisted/manager/cmdgen/getcmd
/docs/hlapi/twisted/manager/cmdgen/setcmd
/docs/hlapi/twisted/manager/cmdgen/nextcmd
/docs/hlapi/twisted/manager/cmdgen/bulkcmd
Notification Originator
.. toctree::
:maxdepth: 2
/docs/hlapi/v3arch/twisted/agent/ntforg/notification
/docs/hlapi/twisted/agent/ntforg/notification
Transport configuration
+++++++++++++++++++++++
@ -170,23 +174,23 @@ Transport configuration
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v3arch.twisted.UdpTransportTarget
.. autoclass:: pysnmp.hlapi.twisted.UdpTransportTarget
:members: setLocalAddress
High-level v3arch SNMP Engine
-----------------------------
SNMP Engine
-----------
SNMP Engine is a central, stateful object used by all SNMP v3
subsystems. Calls to high-level Applications API also consume SNMP
substsems. Calls to high-level Applications API also consume SNMP
Engine object on input.
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v3arch.SnmpEngine(snmpEngineID=None)
.. autoclass:: pysnmp.hlapi.SnmpEngine(snmpEngineID=None)
High-level v3arch auth
----------------------
Security Parameters
-------------------
Calls to high-level Applications API consume Security Parameters
configuration object on input. The shortcut classes described in
@ -199,53 +203,47 @@ Community-based
+++++++++++++++
Security Parameters object is Security Model specific. The
:py:class:`~pysnmp.hlapi.v3arch.CommunityData`
:py:class:`~pysnmp.hlapi.CommunityData`
class is used for configuring Community-Based Security Model of SNMPv1/SNMPv2c.
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v3arch.CommunityData(communityIndex, communityName=None, mpModel=1, contextEngineId=None, contextName='', tag='')
.. autoclass:: pysnmp.hlapi.CommunityData(communityIndex, communityName=None, mpModel=1, contextEngineId=None, contextName='', tag='')
User-based
++++++++++
The :py:class:`~pysnmp.hlapi.v3arch.UsmUserData` class provides SNMPv3 User-Based
The :py:class:`~pysnmp.hlapi.UsmUserData` class provides SNMPv3 User-Based
Security Model configuration for SNMP v3 systems.
.. autoclass:: pysnmp.hlapi.v3arch.UsmUserData(userName, authKey=None, privKey=None, authProtocol=usmNoAuthProtocol, privProtocol=usmNoPrivProtocol, securityEngineId=None)
.. autoclass:: pysnmp.hlapi.UsmUserData(userName, authKey=None, privKey=None, authProtocol=usmNoAuthProtocol, privProtocol=usmNoPrivProtocol, securityEngineId=None)
**Authentication protocol identifiers**
Identification of Authentication and Privacy Protocols is done
via constant OIDs:
.. autodata:: pysnmp.hlapi.v3arch.usmNoAuthProtocol
.. autodata:: pysnmp.hlapi.v3arch.usmHMACMD5AuthProtocol
.. autodata:: pysnmp.hlapi.v3arch.usmHMACSHAAuthProtocol
.. autodata:: pysnmp.hlapi.v3arch.usmHMAC128SHA224AuthProtocol
.. autodata:: pysnmp.hlapi.v3arch.usmHMAC192SHA256AuthProtocol
.. autodata:: pysnmp.hlapi.v3arch.usmHMAC256SHA384AuthProtocol
.. autodata:: pysnmp.hlapi.v3arch.usmHMAC384SHA512AuthProtocol
.. autodata:: pysnmp.hlapi.usmNoAuthProtocol
.. autodata:: pysnmp.hlapi.usmHMACMD5AuthProtocol
.. autodata:: pysnmp.hlapi.usmHMACSHAAuthProtocol
.. autodata:: pysnmp.hlapi.usmHMAC128SHA224AuthProtocol
.. autodata:: pysnmp.hlapi.usmHMAC192SHA256AuthProtocol
.. autodata:: pysnmp.hlapi.usmHMAC256SHA384AuthProtocol
.. autodata:: pysnmp.hlapi.usmHMAC384SHA512AuthProtocol
**Privacy (encryption) protocol identifiers**
.. autodata:: pysnmp.hlapi.v3arch.usmNoPrivProtocol
.. autodata:: pysnmp.hlapi.v3arch.usmDESPrivProtocol
.. autodata:: pysnmp.hlapi.v3arch.usm3DESEDEPrivProtocol
.. autodata:: pysnmp.hlapi.v3arch.usmAesCfb128Protocol
.. autodata:: pysnmp.hlapi.v3arch.usmAesCfb192Protocol
.. autodata:: pysnmp.hlapi.v3arch.usmAesCfb256Protocol
.. autodata:: pysnmp.hlapi.v3arch.usmAesBlumenthalCfb192Protocol
.. autodata:: pysnmp.hlapi.v3arch.usmAesBlumenthalCfb256Protocol
.. note::
SNMP authentication and encryption keys must be at least *eight*
octets long.
.. autodata:: pysnmp.hlapi.usmNoPrivProtocol
.. autodata:: pysnmp.hlapi.usmDESPrivProtocol
.. autodata:: pysnmp.hlapi.usm3DESEDEPrivProtocol
.. autodata:: pysnmp.hlapi.usmAesCfb128Protocol
.. autodata:: pysnmp.hlapi.usmAesCfb192Protocol
.. autodata:: pysnmp.hlapi.usmAesCfb256Protocol
.. autodata:: pysnmp.hlapi.usmAesBlumenthalCfb192Protocol
.. autodata:: pysnmp.hlapi.usmAesBlumenthalCfb256Protocol
Transport configuration is I/O framework specific and is described in
respective sections.
High-level v3arch SNMP Context
------------------------------
SNMP Context
------------
SNMP engine may serve several instances of the same MIB within
possibly multiple SNMP entities. SNMP context is a tool for
@ -269,117 +267,12 @@ SNMP engine. See :RFC:`3411#section-3.3.1` for details.
The SNMP context information necessary for this mapping procedure
to operate is supplied through the
:py:class:`~pysnmp.hlapi.v3arch.CommunityData` object.
:py:class:`~pysnmp.hlapi.CommunityData` object.
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v3arch.ContextData
High-level v1arch sync
----------------------
The synchronous `hlapi.v1arch` API is probably the easiest to use and fast to run,
however it does not support SNMPv3.
Command Generator
.. toctree::
:maxdepth: 2
/docs/hlapi/v1arch/asyncore/sync/manager/cmdgen/getcmd
/docs/hlapi/v1arch/asyncore/sync/manager/cmdgen/setcmd
/docs/hlapi/v1arch/asyncore/sync/manager/cmdgen/nextcmd
/docs/hlapi/v1arch/asyncore/sync/manager/cmdgen/bulkcmd
Notification Originator
.. toctree::
:maxdepth: 2
/docs/hlapi/v1arch/asyncore/sync/agent/ntforg/notification
Transport configuration
+++++++++++++++++++++++
The following shortcut classes convey configuration information to
SNMP engine's Local Configuration Datastore (:RFC:`2271#section-3.4.2`)
as well as to underlying socket API. Once committed to LCD, SNMP engine
saves its configuration for the lifetime of SNMP engine object.
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v1arch.UdpTransportTarget
:members: setLocalAddress
.. autoclass:: pysnmp.hlapi.v1arch.Udp6TransportTarget
:members: setLocalAddress
High-level v1arch asyncore
--------------------------
The :mod:`asyncore` module is in Python standard library since ancient
times. Main loop is built around :mod:`select` dispatcher, user
code is invoked through callback callables.
Command Generator
.. toctree::
:maxdepth: 2
/docs/hlapi/v1arch/asyncore/manager/cmdgen/getcmd
/docs/hlapi/v1arch/asyncore/manager/cmdgen/setcmd
/docs/hlapi/v1arch/asyncore/manager/cmdgen/nextcmd
/docs/hlapi/v1arch/asyncore/manager/cmdgen/bulkcmd
Notification Originator
.. toctree::
:maxdepth: 2
/docs/hlapi/v1arch/asyncore/agent/ntforg/notification
Transport configuration
+++++++++++++++++++++++
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v1arch.asyncore.UdpTransportTarget
:members: setLocalAddress
.. autoclass:: pysnmp.hlapi.v1arch.asyncore.Udp6TransportTarget
:members: setLocalAddress
High-level v1arch SNMP Dispatcher
---------------------------------
SNMP Dispatcher is a stateful object representing asynchronous
I/O event loop and also holding some caches. Calls to `v1arch`
always require consume SNMP Dispatcher object on input.
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v1arch.SnmpDispatcher()
High-level v1arch auth
----------------------
Calls to `v1arch` API require SNMP authentication object on input.
Community-based
+++++++++++++++
Security Parameters object is Security Model specific. The
:py:class:`~pysnmp.hlapi.v1arch.CommunityData`
class is used for configuring Community-Based Security Model of SNMPv1/SNMPv2c.
.. toctree::
:maxdepth: 2
.. autoclass:: pysnmp.hlapi.v1arch.CommunityData(communityName, mpModel=1)
.. autoclass:: pysnmp.hlapi.ContextData
.. _mib-services:
@ -441,20 +334,6 @@ data description language. PySNMP types are derived from
.. toctree::
:maxdepth: 2
.. _null:
Null type
+++++++++
.. autoclass:: pysnmp.proto.rfc1902.Null(initializer)
:members:
.. note::
The `NULL` type actually belongs to the base ASN.1 types. It is not defined
in :RFC:`1902#section-2` as an SNMP type. The `Null` type is exposed through
`rfc1902` module just for convenience.
.. _integer32:
Integer32 type

View File

@ -5,4 +5,4 @@ TRAP/INFORM notification
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.sendNotification
.. autofunction:: pysnmp.hlapi.asyncio.sendNotification

View File

@ -5,4 +5,4 @@ GETBULK command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.bulkCmd
.. autofunction:: pysnmp.hlapi.asyncio.bulkCmd

View File

@ -5,4 +5,4 @@ GET command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.getCmd
.. autofunction:: pysnmp.hlapi.asyncio.getCmd

View File

@ -5,4 +5,4 @@ GETNEXT command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.nextCmd
.. autofunction:: pysnmp.hlapi.asyncio.nextCmd

View File

@ -5,4 +5,4 @@ SET command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.setCmd
.. autofunction:: pysnmp.hlapi.asyncio.setCmd

View File

@ -5,4 +5,4 @@ TRAP/INFORM notification
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncio.sendNotification
.. autofunction:: pysnmp.hlapi.asyncore.sendNotification

View File

@ -5,4 +5,4 @@ GETBULK command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncio.bulkCmd
.. autofunction:: pysnmp.hlapi.asyncore.bulkCmd

View File

@ -5,4 +5,4 @@ GET command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncio.getCmd
.. autofunction:: pysnmp.hlapi.asyncore.getCmd

View File

@ -5,4 +5,4 @@ GETNEXT command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.twisted.nextCmd
.. autofunction:: pysnmp.hlapi.asyncore.nextCmd

View File

@ -5,4 +5,4 @@ SET command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.twisted.setCmd
.. autofunction:: pysnmp.hlapi.asyncore.setCmd

View File

@ -5,4 +5,4 @@ TRAP/INFORM notification
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.twisted.sendNotification
.. autofunction:: pysnmp.hlapi.twisted.sendNotification

View File

@ -5,4 +5,4 @@ GETBULK command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.twisted.bulkCmd
.. autofunction:: pysnmp.hlapi.twisted.bulkCmd

View File

@ -5,4 +5,4 @@ GET command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.twisted.getCmd
.. autofunction:: pysnmp.hlapi.twisted.getCmd

View File

@ -5,4 +5,4 @@ GETNEXT command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncio.nextCmd
.. autofunction:: pysnmp.hlapi.twisted.nextCmd

View File

@ -5,4 +5,4 @@ SET command
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncio.setCmd
.. autofunction:: pysnmp.hlapi.twisted.setCmd

View File

@ -1,8 +0,0 @@
TRAP/INFORM notification
========================
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.asyncore.sendNotification

View File

@ -1,8 +0,0 @@
GETBULK command
===============
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.asyncore.bulkCmd

View File

@ -1,8 +0,0 @@
GET command
===========
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.asyncore.getCmd

View File

@ -1,8 +0,0 @@
GETNEXT command
===============
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.asyncore.nextCmd

View File

@ -1,8 +0,0 @@
SET command
===========
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v1arch.asyncore.setCmd

View File

@ -1,8 +0,0 @@
TRAP/INFORM notification
========================
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncore.sendNotification

View File

@ -1,8 +0,0 @@
GETBULK command
===============
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncore.bulkCmd

View File

@ -1,8 +0,0 @@
GET command
===========
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncore.getCmd

View File

@ -1,8 +0,0 @@
GETNEXT command
===============
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncore.nextCmd

View File

@ -1,8 +0,0 @@
SET command
===========
.. toctree::
:maxdepth: 2
.. autofunction:: pysnmp.hlapi.v3arch.asyncore.setCmd

View File

@ -9,7 +9,7 @@ We can look at PySNMP's internal structure from the view point of
SNMP protocol evolution. SNMP was evolving for many years from
a relatively simple way to structure and retrieve data (SNMPv1/v2c)
all the way to extensible and modularized framework that supports
strong SNMPv3 crypto (with optional pysnmpcrypto package).
strong crypto out-of-the-box (SNMPv3).
In the order from most ancient SNMP services to the most current ones,
what follows are different layers of PySNMP APIs:

View File

@ -126,7 +126,7 @@ objects representing completely different instances of hardware
or software being managed. This is where SNMP context could
be used.
To indicate SNMP context at high-level API a properly initialized
To indicate SNMP context at high-level API a preperly initialized
:py:class:`~pysnmp.hlapi.ContextData` object should be used.
For this example we will use the 'empty' context (default).
@ -242,7 +242,7 @@ in `SNMPv2-MIB <http://mibs.snmplabs.com/asn1/SNMPv2-MIB>`_ module.
By default PySNMP will search your local filesystem for ASN.1 MIB files
you refer to. It can also be configured to automatically download
them from remote hosts, as
:doc:`shown </examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/mib-tweaks>`
:doc:`shown </examples/hlapi/asyncore/sync/manager/cmdgen/mib-tweaks>`
in the examples. We maintain a
`collection <http://mibs.snmplabs.com/asn1/>`_ of ASN.1 MIB modules
that you can use in your SNMP projects.

View File

@ -227,7 +227,7 @@ engine loads those modules at runtime on demand. PySNMP MIB modules
are universal -- the same module can be consumed by both managed and
managing entities.
MIB conversion is performed automatically by PySNMP, but technically,
MIB convertion is performed automatically by PySNMP, but technically,
it is handled by PySNMP sister project called
`PySMI <http://snmplabs.com/pysmi/>`_. However you can also perform said
conversion by hand with PySMI's *mibdump.py* tool.

View File

@ -1,6 +1,6 @@
Overview
========
Documentation
=============
.. toctree::
:maxdepth: 2

View File

@ -6,7 +6,7 @@ Download PySNMP
The PySNMP software is provided under terms and conditions of BSD-style
license, and can be freely downloaded from
`PyPI <https://pypi.org/project/pysnmp/>`_ or
`PyPI <http://pypi.python.org/pypi/pysnmp/>`_ or
GitHub (`master branch <https://github.com/etingof/pysnmp/archive/master.zip>`_).
@ -30,7 +30,7 @@ or
In case you do not have the easy_install command on your system but still
would like to use the on-line package installation method, please install
`setuptools <https://pypi.org/project/setuptools/>`_ package by
`setuptools <http://pypi.python.org/pypi/setuptools>`_ package by
downloading and running `ez_setup.pz <https://bootstrap.pypa.io/ez_setup.py>`_ bootstrap:
.. code-block:: bash
@ -42,17 +42,19 @@ In case you are installing PySNMP on an off-line system, the following
packages need to be downloaded and installed for PySNMP to become
operational:
* `pysnmp <https://pypi.org/project/pysnmp/>`_,
SNMP engine implementation
* `pyasn1 <https://pypi.org/project/pyasn1/>`_,
* `PyASN1 <https://pypi.python.org/pypi/pyasn1>`_,
used for handling ASN.1 objects
* `pysmi <https://pypi.org/project/pysmi/>`_ for automatic
* `PySNMP <https://pypi.python.org/pypi/pysnmp/>`_,
SNMP engine implementation
Optional, but recommended:
* `PyCryptodomex <https://pypi.python.org/pypi/pycryptodomex/>`_,
used by SNMPv3 crypto features
* `PySMI <https://pypi.python.org/pypi/pysmi/>`_ for automatic
MIB download and compilation. That helps visualizing more SNMP objects
Optional:
* `pysnmpcrypto <https://pypi.org/project/pysnmpcrypto/>`_,
for strong SNMPv3 crypto support
* `Ply <https://pypi.python.org/pypi/ply/>`_, parser generator
required by PySMI
The installation procedure for all the above packages is as follows
(on UNIX-based systems):

View File

@ -9,82 +9,51 @@ SNMP is not simple (PySNMP implementation takes over 15K lines of
Python code), but PySNMP tries to hide the complexities and let you
carry out typical SNMP operations in a quick and intuitive way.
PySNMP offers high and low-level programming interfaces to deal with
SNMP protocol.
The other dimension of differences in the PySNMP APIs is that there are
two different SNMP implementations - the initial architecture
(`RFC1901 <https://tools.ietf.org/html/rfc1901>`_ ..
`RFC1905 <https://tools.ietf.org/html/rfc1905>`_) also known as SNMP v1 architecture
and the redesigned variant (`RFC3413 <https://tools.ietf.org/html/rfc3413>`_
and others) -- SNMPv3 architecture.
.. note::
The SNMP v1 architecture supports SNMP protocol versions 1 and 2c,
while SNMP v3 architecture supports versions 1, 2c and 3. Whatever
new amendments to the SNMP protocol may come up in the future, they
will be implemented within the v3 model.
PySNMP offers three groups of programming interfaces to deal with
SNMP protocol. In the order from most concise to most detailed those
APIs follow.
High-level SNMP
---------------
The high-level API (`hlapi`) is designed to be simple, concise and
suitable for the most typical client-side operations. For that matter,
only Command Generator and Notification Originator Applications are
The so called high-level API (hlapi) is designed to be simple, concise and
suitable for the most frequent operations. For that matter only
Command Generator and Notification Originator Applications are currently
wrapped into a nearly one-line Python expression.
The `hlapi` interfaces come in several flavours: one synchronous
and a bunch of asynchronous, adapted to work withing the event loops
of popular asynchronous I/O frameworks.
The primary reason for maintaining high-level API over both `v1arch` and
`v3arch` is performance - `v3arch` machinery is much more functional and complicated
internally, that translates to being heavier on resources and therefore slower.
The v3 architecture
+++++++++++++++++++
It comes in several flavours: one synchronous and a bunch of bindings to
popular asynchronous I/O frameworks. Those varieties of APIs bring
subtile differences, mostly to better match particular I/O framework
customs. Unless you have a very specific task, the high-level API might
solve your SNMP needs.
.. toctree::
:maxdepth: 2
/examples/hlapi/v3arch/asyncore/sync/contents
/examples/hlapi/asyncore/sync/contents
.. toctree::
:maxdepth: 2
/examples/hlapi/v3arch/asyncore/contents
/examples/hlapi/asyncore/contents
.. toctree::
:maxdepth: 2
/examples/hlapi/v3arch/asyncio/contents
/examples/hlapi/asyncio/contents
.. toctree::
:maxdepth: 2
/examples/hlapi/v3arch/trollius/contents
/examples/hlapi/trollius/contents
.. toctree::
:maxdepth: 2
/examples/hlapi/v3arch/twisted/contents
/examples/hlapi/twisted/contents
The v1 architecture
+++++++++++++++++++
.. toctree::
:maxdepth: 2
/examples/hlapi/v1arch/asyncore/sync/contents
.. toctree::
:maxdepth: 2
/examples/hlapi/v1arch/asyncore/contents
Low-level v3 architecture
-------------------------
Native SNMP API
---------------
Complete implementation of all official Standard SNMP Applications. It
should let you implement any SNMP operation defined in the standard
@ -101,8 +70,8 @@ framework being used.
/examples/v3arch/trollius/contents
/examples/v3arch/twisted/contents
Low-level v1 architecture
-------------------------
Packet-level SNMP
-----------------
In cases where performance is your top priority and you only need to
work with SNMP v1 and v2c systems and you do not mind writing much
@ -147,14 +116,15 @@ Notification Receiver
/examples/v1arch/asyncore/manager/ntfrcv/transport-tweaks
Low-level SMI/MIB
-----------------
Low-level MIB access
--------------------
.. toctree::
/examples/smi/manager/browsing-mib-tree
/examples/smi/agent/implementing-mib-objects
Using these examples
--------------------

View File

@ -0,0 +1,17 @@
.. toctree::
:maxdepth: 2
Advanced Notification Originator
--------------------------------
.. include:: /../../examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncio/agent/ntforg/multiple-notifications-at-once.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,17 @@
.. toctree::
:maxdepth: 2
Common notifications
--------------------
.. include:: /../../examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,6 +1,6 @@
Asynchronous SNMP (asynio, v3arch)
==================================
Asynchronous: asyncio
=====================
The :mod:`asyncio` module first appeared in standard library since
Python 3.3 (in provisional basis). Its main design feature is that it
@ -8,8 +8,8 @@ makes asynchronous code looking like synchronous one thus eliminating
"callback hell".
With `asyncio` built-in facilities, you could run many SNMP queries
in parallel and/or sequentially, interleave SNMP queries with other I/O
operations. See `asyncio resources <http://asyncio.org>`_
in parallel and/or sequentially, interleave SNMP queries with I/O
operations with other systems. See `asyncio resources <http://asyncio.org>`_
repository for other `asyncio`-compatible modules.
In most examples approximate analogues of well known Net-SNMP snmp* tools
@ -18,11 +18,11 @@ are familiar with Net-SNMP tools, better understanding what example code doe
Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/v1-get.py
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/v1-get.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/v1-get.py
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
@ -30,11 +30,11 @@ To make use of SNMPv3 and USM, the following code performs a series of
SNMP GETNEXT operations effectively fetching a table of SNMP variables
from SNMP Agent:
.. include:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/getbulk-to-eom.py
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/getbulk-to-eom.py
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
@ -42,18 +42,18 @@ More examples on Command Generator API usage follow.
.. toctree::
/examples/hlapi/v3arch/asyncio/manager/cmdgen/snmp-versions
/examples/hlapi/v3arch/asyncio/manager/cmdgen/walking-operations
/examples/hlapi/v3arch/asyncio/manager/cmdgen/advanced-topics
/examples/hlapi/asyncio/manager/cmdgen/snmp-versions
/examples/hlapi/asyncio/manager/cmdgen/walking-operations
/examples/hlapi/asyncio/manager/cmdgen/advanced-topics
Sending SNMP TRAP's and INFORM's is as easy with PySNMP library.
The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/v3arch/asyncio/agent/ntforg/default-v1-trap.py
.. include:: /../../examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncio/agent/ntforg/default-v1-trap.py
.. literalinclude:: /../../examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
@ -61,8 +61,8 @@ More examples on Notification Originator API usage follow.
.. toctree::
/examples/hlapi/v3arch/asyncio/agent/ntforg/common-notifications
/examples/hlapi/v3arch/asyncio/agent/ntforg/advanced-topics
/examples/hlapi/asyncio/agent/ntforg/common-notifications
/examples/hlapi/asyncio/agent/ntforg/advanced-topics
More sophisticated or less popular SNMP operations can still be performed
with PySNMP through its Native API to Standard SNMP Applications.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
Advanced Command Generator
--------------------------
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncio/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py>` script.
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/multiple-sequential-queries.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/multiple-sequential-queries.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncio/manager/cmdgen/multiple-sequential-queries.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
Various SNMP versions
----------------------
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/v1-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncio/manager/cmdgen/v1-get.py>` script.
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,17 @@
.. toctree::
:maxdepth: 2
Walking operations
------------------
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,40 @@
.. toctree::
:maxdepth: 2
Advanced Notification Originator
--------------------------------
.. include:: /../../examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/agent/ntforg/multiple-traps-at-once.py>` script.
.. include:: /../../examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/agent/ntforg/multiple-informs-at-once.py>` script.
.. include:: /../../examples/hlapi/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,17 @@
.. toctree::
:maxdepth: 2
Common notifications
--------------------
.. include:: /../../examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,30 +1,22 @@
Asynchronous SNMP (asyncore, v3arch)
====================================
Asynchronous: asyncore
======================
With :mod:`asyncore` API your scripts get CPU time on :mod:`socket`
events being watched for by :mod:`select` dispatcher. Your code
live mostly in isolated functions (or any callable objects).
As it is with any asynchronous I/O system, `asyncore` lets you run
many SNMP queries in parallel and/or sequentially, interleave SNMP
queries with other I/O operations for as long as they are managed
within the same event loop.
The :mod:`pysnmp.hlapi.v3arch.asyncore` package implements `asyncore`
binding to pysnmp's `v3arch` services.
In most examples approximate analogues of well known Net-SNMP snmp* tools
command line options are shown. That may help those readers who, by chance
are familiar with Net-SNMP tools, better understanding what example code doe
Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/v2c-get.py
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/v2c-get.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/v2c-get.py
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/v2c-get.py
:start-after: """#
:language: python
@ -32,11 +24,11 @@ To make use of SNMPv3 and USM, the following code performs a series of
SNMP GETNEXT operations effectively fetching a table of SNMP variables
from SNMP Agent:
.. include:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-whole-mib.py
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-whole-mib.py
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
@ -44,18 +36,18 @@ More examples on Command Generator API usage follow.
.. toctree::
/examples/hlapi/v3arch/asyncore/manager/cmdgen/snmp-versions
/examples/hlapi/v3arch/asyncore/manager/cmdgen/walking-operations
/examples/hlapi/v3arch/asyncore/manager/cmdgen/advanced-topics
/examples/hlapi/asyncore/manager/cmdgen/snmp-versions
/examples/hlapi/asyncore/manager/cmdgen/walking-operations
/examples/hlapi/asyncore/manager/cmdgen/advanced-topics
Sending SNMP TRAP's and INFORM's is as easy with PySNMP library.
The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/default-v1-trap.py
.. include:: /../../examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/default-v1-trap.py
.. literalinclude:: /../../examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
@ -63,8 +55,8 @@ More examples on Notification Originator API usage follow.
.. toctree::
/examples/hlapi/v3arch/asyncore/agent/ntforg/common-notifications
/examples/hlapi/v3arch/asyncore/agent/ntforg/advanced-topics
/examples/hlapi/asyncore/agent/ntforg/common-notifications
/examples/hlapi/asyncore/agent/ntforg/advanced-topics
More sophisticated or less popular SNMP operations can still be performed
with PySNMP through its Native API to Standard SNMP Applications.

View File

@ -0,0 +1,40 @@
.. toctree::
:maxdepth: 2
Advanced Command Generator
--------------------------
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once-over-ipv4-and-ipv6.py>` script.
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/query-multiple-snmp-engines-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/query-multiple-snmp-engines-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/manager/cmdgen/query-multiple-snmp-engines-over-ipv4-and-ipv6.py>` script.
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
Various SNMP versions
----------------------
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/v2c-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/v2c-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/manager/cmdgen/v2c-get.py>` script.
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,18 @@
.. toctree::
:maxdepth: 2
Walking operations
------------------
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,28 @@
.. toctree::
:maxdepth: 2
Advanced Notification Originator
--------------------------------
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/custom-contextname.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/custom-contextengineid.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,49 @@
.. toctree::
:maxdepth: 2
Common notifications
--------------------
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/v3-inform.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/v3-trap.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
Evaluating NOTIFICATION-TYPE
----------------------------
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
SNMPv1 TRAP variants
--------------------
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/custom-v1-trap.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,6 +1,6 @@
Synchronous SNMP (v3arch)
=========================
Synchronous SNMP
================
This chapter illustrates various uses of the synchronous high-level
programming interface to some of Standard SNMP Applications, as defined in
@ -11,16 +11,15 @@ programming interface to some of Standard SNMP Applications, as defined in
In most examples approximate analogues of well known Net-SNMP snmp* tools
command line options are shown. That may help those readers who, by chance
are familiar with Net-SNMP tools, better understanding what the example code
does.
are familiar with Net-SNMP tools, better understanding what example code doe
Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/v1-get.py
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/v1-get.py
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
@ -28,11 +27,11 @@ To make use of SNMPv3 and USM, the following code performs a series of
SNMP GETNEXT operations effectively fetching a table of SNMP variables
from SNMP Agent:
.. include:: /../../examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
@ -40,22 +39,22 @@ More examples on Command Generator API usage follow.
.. toctree::
/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/snmp-versions
/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/modifying-variables
/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/walking-operations
/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/table-operations
/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/mib-tweaks
/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/transport-tweaks
/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/advanced-topics
/examples/hlapi/asyncore/sync/manager/cmdgen/snmp-versions
/examples/hlapi/asyncore/sync/manager/cmdgen/modifying-variables
/examples/hlapi/asyncore/sync/manager/cmdgen/walking-operations
/examples/hlapi/asyncore/sync/manager/cmdgen/table-operations
/examples/hlapi/asyncore/sync/manager/cmdgen/mib-tweaks
/examples/hlapi/asyncore/sync/manager/cmdgen/transport-tweaks
/examples/hlapi/asyncore/sync/manager/cmdgen/advanced-topics
Sending SNMP TRAP's and INFORM's is as easy with PySNMP library.
The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py
.. include:: /../../examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py
.. literalinclude:: /../../examples/hlapi/asyncore/sync/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
@ -63,10 +62,10 @@ More examples on Notification Originator API usage follow.
.. toctree::
/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/common-notifications
/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/snmp-v1-trap-variants
/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/evaluating-notification-type
/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/advanced-topics
/examples/hlapi/asyncore/sync/agent/ntforg/common-notifications
/examples/hlapi/asyncore/sync/agent/ntforg/snmp-v1-trap-variants
/examples/hlapi/asyncore/sync/agent/ntforg/evaluating-notification-type
/examples/hlapi/asyncore/sync/agent/ntforg/advanced-topics
More sophisticated or less popular SNMP operations can still be performed
with PySNMP through its Native API to Standard SNMP Applications.

View File

@ -0,0 +1,84 @@
.. toctree::
:maxdepth: 2
Advanced Command Generator
--------------------------
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/multiple-get-calls.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/multiple-get-calls.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/multiple-get-calls.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid-and-contextname.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid-and-contextname.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid-and-contextname.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-v3-security-name.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-v3-security-name.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-v3-security-name.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/specific-v3-engine-id.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/specific-v3-engine-id.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/specific-v3-engine-id.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,48 @@
.. toctree::
:maxdepth: 2
MIB tweaks
----------
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/waive-mib-lookup.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/waive-mib-lookup.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/waive-mib-lookup.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,30 @@
.. toctree::
:maxdepth: 2
Modifying variables
-------------------
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py>` script.
See also: :doc:`library-reference </docs/api-reference>`.

View File

@ -0,0 +1,72 @@
.. toctree::
:maxdepth: 2
SNMP versions
-------------
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/v2c-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/v2c-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/v2c-get.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-des.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-des.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-des.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-none-none.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-none-none.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-none-none.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-sha-aes128.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-sha-aes128.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/usm-sha-aes128.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
Transport tweaks
----------------
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-timeout-and-retries.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-timeout-and-retries.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/custom-timeout-and-retries.py>` script.
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/fetch-variables-over-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/fetch-variables-over-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/fetch-variables-over-ipv6.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,18 @@
.. toctree::
:maxdepth: 2
Walking operations
------------------
.. include:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,17 @@
.. toctree::
:maxdepth: 2
Common notifications
--------------------
.. include:: /../../examples/hlapi/trollius/agent/ntforg/default-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/trollius/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/trollius/agent/ntforg/default-v1-trap.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,6 +1,6 @@
Asynchronous SNMP (trollius, v3arch)
====================================
Asynchronous: trollius
======================
In order to use :mod:`asyncio` features with older Python (2.6+), you
could download and install `Trollius <http://trollius.readthedocs.org/>`_
@ -12,11 +12,11 @@ are familiar with Net-SNMP tools, better understanding what example code doe
Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/v3arch/trollius/manager/cmdgen/v1-get.py
.. include:: /../../examples/hlapi/trollius/manager/cmdgen/v1-get.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/trollius/manager/cmdgen/v1-get.py
.. literalinclude:: /../../examples/hlapi/trollius/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
@ -24,11 +24,11 @@ To make use of SNMPv3 and USM, the following code performs a series of
SNMP GETNEXT operations effectively fetching a table of SNMP variables
from SNMP Agent:
.. include:: /../../examples/hlapi/v3arch/trollius/manager/cmdgen/getbulk-to-eom.py
.. include:: /../../examples/hlapi/trollius/manager/cmdgen/getbulk-to-eom.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/trollius/manager/cmdgen/getbulk-to-eom.py
.. literalinclude:: /../../examples/hlapi/trollius/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
@ -36,17 +36,17 @@ More examples on Command Generator API usage follow.
.. toctree::
/examples/hlapi/v3arch/trollius/manager/cmdgen/snmp-versions
/examples/hlapi/v3arch/trollius/manager/cmdgen/walking-operations
/examples/hlapi/trollius/manager/cmdgen/snmp-versions
/examples/hlapi/trollius/manager/cmdgen/walking-operations
Sending SNMP TRAP's and INFORM's is as easy with PySNMP library.
The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/v3arch/trollius/agent/ntforg/default-v1-trap.py
.. include:: /../../examples/hlapi/trollius/agent/ntforg/default-v1-trap.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/trollius/agent/ntforg/default-v1-trap.py
.. literalinclude:: /../../examples/hlapi/trollius/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
@ -54,7 +54,7 @@ More examples on Notification Originator API usage follow.
.. toctree::
/examples/hlapi/v3arch/trollius/agent/ntforg/common-notifications
/examples/hlapi/trollius/agent/ntforg/common-notifications
More sophisticated or less popular SNMP operations can still be performed
with PySNMP through its Native API to Standard SNMP Applications.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
Various SNMP versions
----------------------
.. include:: /../../examples/hlapi/trollius/manager/cmdgen/v1-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/trollius/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/trollius/manager/cmdgen/v1-get.py>` script.
.. include:: /../../examples/hlapi/trollius/manager/cmdgen/getbulk-to-eom.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/trollius/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/trollius/manager/cmdgen/getbulk-to-eom.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,17 @@
.. toctree::
:maxdepth: 2
Walking operations
------------------
.. include:: /../../examples/hlapi/trollius/manager/cmdgen/getbulk-to-eom.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/trollius/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/trollius/manager/cmdgen/getbulk-to-eom.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,17 @@
.. toctree::
:maxdepth: 2
Advanced Notification Originator
--------------------------------
.. include:: /../../examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/agent/ntforg/multiple-notifications-at-once.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,27 @@
.. toctree::
:maxdepth: 2
Common notifications
--------------------
.. include:: /../../examples/hlapi/twisted/agent/ntforg/default-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/agent/ntforg/default-v1-trap.py>` script.
.. include:: /../../examples/hlapi/twisted/agent/ntforg/v2c-trap-inline-callbacks.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/agent/ntforg/v2c-trap-inline-callbacks.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/agent/ntforg/v2c-trap-inline-callbacks.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,8 +1,8 @@
Asynchronous SNMP (twisted, v3arch)
===================================
Asynchronous: Twisted
=====================
`Twisted <http://twistedmatrix.com>`_ is quite old but still widely used
`Twisted <http://twistedmatrix.com>`_ is quite old and widly used
I/O framework. With Twisted, your code will mostly live in isolated
functions, but unlike as it is with callback-based design, with Twisted
work-in-progress is represented by a
@ -20,11 +20,11 @@ are familiar with Net-SNMP tools, better understanding what example code doe
Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/v3arch/twisted/manager/cmdgen/v1-get.py
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/v1-get.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/twisted/manager/cmdgen/v1-get.py
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
@ -32,11 +32,11 @@ To make use of SNMPv3 and USM, the following code performs a series of
SNMP GETNEXT operations effectively fetching a table of SNMP variables
from SNMP Agent:
.. include:: /../../examples/hlapi/v3arch/twisted/manager/cmdgen/getbulk-to-eom.py
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/twisted/manager/cmdgen/getbulk-to-eom.py
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
@ -44,19 +44,19 @@ More examples on Command Generator API usage follow.
.. toctree::
/examples/hlapi/v3arch/twisted/manager/cmdgen/snmp-versions
/examples/hlapi/v3arch/twisted/manager/cmdgen/walking-operations
/examples/hlapi/v3arch/twisted/manager/cmdgen/transport-tweaks
/examples/hlapi/v3arch/twisted/manager/cmdgen/advanced-topics
/examples/hlapi/twisted/manager/cmdgen/snmp-versions
/examples/hlapi/twisted/manager/cmdgen/walking-operations
/examples/hlapi/twisted/manager/cmdgen/transport-tweaks
/examples/hlapi/twisted/manager/cmdgen/advanced-topics
Sending SNMP TRAP's and INFORM's is as easy with PySNMP library.
The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/v3arch/twisted/agent/ntforg/default-v1-trap.py
.. include:: /../../examples/hlapi/twisted/agent/ntforg/default-v1-trap.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v3arch/twisted/agent/ntforg/default-v1-trap.py
.. literalinclude:: /../../examples/hlapi/twisted/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
@ -64,8 +64,8 @@ More examples on Notification Originator API usage follow.
.. toctree::
/examples/hlapi/v3arch/twisted/agent/ntforg/common-notifications
/examples/hlapi/v3arch/twisted/agent/ntforg/advanced-topics
/examples/hlapi/twisted/agent/ntforg/common-notifications
/examples/hlapi/twisted/agent/ntforg/advanced-topics
More sophisticated or less popular SNMP operations can still be performed
with PySNMP through its Native API to Standard SNMP Applications.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
Advanced Command Generator
--------------------------
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/multiple-concurrent-queries.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/multiple-concurrent-queries.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/manager/cmdgen/multiple-concurrent-queries.py>` script.
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,29 @@
.. toctree::
:maxdepth: 2
Various SNMP versions
----------------------
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/v1-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/manager/cmdgen/v1-get.py>` script.
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,17 @@
.. toctree::
:maxdepth: 2
Transport tweaks
----------------
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/custom-timeout-and-retries.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/custom-timeout-and-retries.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/manager/cmdgen/custom-timeout-and-retries.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -0,0 +1,27 @@
.. toctree::
:maxdepth: 2
Walking operations
------------------
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/manager/cmdgen/getbulk-to-eom.py>` script.
.. include:: /../../examples/hlapi/twisted/manager/cmdgen/pull-whole-mib.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/twisted/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/twisted/manager/cmdgen/pull-whole-mib.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,7 +0,0 @@
.. toctree::
:maxdepth: 2
Advanced Notification Originator
--------------------------------
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,49 +0,0 @@
.. toctree::
:maxdepth: 2
Common notifications
--------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-inform.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-inform.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-inform.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v2c-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v2c-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v2c-trap.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,18 +0,0 @@
.. toctree::
:maxdepth: 2
Evaluating NOTIFICATION-TYPE
----------------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,60 +0,0 @@
Asynchronous SNMP (asyncore, v1arch)
====================================
Applications build around :mod:`asyncore` get CPU time on :mod:`socket`
events being watched for by :mod:`select` dispatcher. User code
lives mostly in isolated functions (or any callable objects).
As it is with any asynchronous I/O system, `asyncore` lets you run
many SNMP queries in parallel and/or sequentially, interleave SNMP
queries with other I/O operations for as long as they are managed
within the same event loop.
The :mod:`pysnmp.hlapi.v1arch.asyncore` package implements `asyncore`
binding to pysnmp's `v1arch` services.
In most examples approximate analogues of well known Net-SNMP snmp* tools
command line options are shown. That may help those readers who, by chance
are familiar with Net-SNMP tools, better understanding what example code doe
Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/v1arch/asyncore/manager/cmdgen/v2c-get.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/manager/cmdgen/v2c-get.py
:start-after: """#
:language: python
.. toctree::
/examples/hlapi/v1arch/asyncore/manager/cmdgen/snmp-versions
/examples/hlapi/v1arch/asyncore/manager/cmdgen/modifying-variables
/examples/hlapi/v1arch/asyncore/manager/cmdgen/walking-operations
/examples/hlapi/v1arch/asyncore/manager/cmdgen/table-operations
/examples/hlapi/v1arch/asyncore/manager/cmdgen/mib-tweaks
/examples/hlapi/v1arch/asyncore/manager/cmdgen/transport-tweaks
/examples/hlapi/v1arch/asyncore/manager/cmdgen/advanced-topics
The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/v1arch/asyncore/agent/ntforg/generic-v1-trap.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/agent/ntforg/generic-v1-trap.py
:start-after: """#
:language: python
More examples on Notification Originator API usage follow.
.. toctree::
/examples/hlapi/v1arch/asyncore/agent/ntforg/common-notifications
/examples/hlapi/v1arch/asyncore/agent/ntforg/evaluating-notification-type
/examples/hlapi/v1arch/asyncore/agent/ntforg/advanced-topics
More sophisticated SNMP operations can still be performed with
PySNMP via its Native API to Standard SNMP Applications.

View File

@ -1,39 +0,0 @@
.. toctree::
:maxdepth: 2
Advanced Command Generator
--------------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/multiple-get-calls.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/multiple-get-calls.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/multiple-get-calls.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,48 +0,0 @@
.. toctree::
:maxdepth: 2
MIB tweaks
----------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/enable-mib-lookup.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/enable-mib-lookup.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/enable-mib-lookup.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,30 +0,0 @@
.. toctree::
:maxdepth: 2
Modifying variables
-------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py>` script.
See also: :doc:`library-reference </docs/api-reference>`.

View File

@ -1,30 +0,0 @@
.. toctree::
:maxdepth: 2
Various SNMP versions
----------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/manager/cmdgen/v2c-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/manager/cmdgen/v2c-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/manager/cmdgen/v2c-get.py>` script.
.. comment
.. include:: /../../examples/hlapi/v1arch/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/manager/cmdgen/pull-whole-mib.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,50 +0,0 @@
.. toctree::
:maxdepth: 2
Table operations
----------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-fetch-scalar-and-table-variables-over-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-fetch-scalar-and-table-variables-over-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-fetch-scalar-and-table-variables-over-ipv6.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-snmp-table.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-snmp-table.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-snmp-table.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,29 +0,0 @@
.. toctree::
:maxdepth: 2
Transport tweaks
----------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-timeout-and-retries.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-timeout-and-retries.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-timeout-and-retries.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/fetch-variables-over-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/fetch-variables-over-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/fetch-variables-over-ipv6.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,18 +0,0 @@
.. toctree::
:maxdepth: 2
Walking operations
------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,59 +0,0 @@
.. toctree::
:maxdepth: 2
Common notifications
--------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v2c-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v2c-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v2c-trap.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-inform.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-inform.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-inform.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v1-trap.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,17 +0,0 @@
.. toctree::
:maxdepth: 2
Evaluating NOTIFICATION-TYPE
----------------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/v2c-trap-with-notification-objects.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,74 +0,0 @@
Synchronous SNMP (v1arch)
=========================
This chapter illustrates various uses of the synchronous high-level
programming interface to client-side SNMP entities along the lines
of `RFC1905 <https://tools.ietf.org/html/rfc1905>`_.
.. note:: The following examples involve creating Python iterator,
the next() call is used to invoke iterator just once.
In most examples approximate analogues of well known Net-SNMP snmp* tools
command line options are shown. That may help those readers who, by chance
are familiar with Net-SNMP tools, better understanding what the example
code does.
Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
.. note::
If MIB lookup is required (e.g. when :py:class:`~pysnmp.smi.rfc1902.ObjectIdentity`,
:py:class:`~pysnmp.smi.rfc1902.ObjectType` or :py:class:`~pysnmp.smi.rfc1902.NotificationType`
objects being used), the `lookupMib=True` should also be passed.
The following code performs a series of SNMP GETNEXT operations
fetching a table of SNMP variables from SNMP Agent:
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
More examples on Command Generator API usage follow.
.. toctree::
/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/snmp-versions
/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/modifying-variables
/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/walking-operations
/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/table-operations
/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/mib-tweaks
/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/transport-tweaks
/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/advanced-topics
The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v2c-trap.py
:start-after: options:
:end-before: Functionally
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/agent/ntforg/generic-v2c-trap.py
:start-after: """#
:language: python
More examples on Notification Originator API usage follow.
.. toctree::
/examples/hlapi/v1arch/asyncore/sync/agent/ntforg/common-notifications
/examples/hlapi/v1arch/asyncore/sync/agent/ntforg/evaluating-notification-type
More specific SNMP operations can still be performed with PySNMP via
its Native API to Standard SNMP Applications.

View File

@ -1,39 +0,0 @@
.. toctree::
:maxdepth: 2
Advanced Command Generator
--------------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/getbulk-limit-number-of-packets.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/multiple-get-calls.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/multiple-get-calls.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/multiple-get-calls.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/query-agents-from-multuple-threads-over-ipv4-and-ipv6.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,48 +0,0 @@
.. toctree::
:maxdepth: 2
MIB tweaks
----------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/enable-mib-lookup.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/enable-mib-lookup.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/enable-mib-lookup.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/preload-pysnmp-mibs.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,30 +0,0 @@
.. toctree::
:maxdepth: 2
Modifying variables
-------------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py>` script.
See also: :doc:`library-reference </docs/api-reference>`.

View File

@ -1,29 +0,0 @@
.. toctree::
:maxdepth: 2
SNMP versions
-------------
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v1-get.py>` script.
.. include:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v2c-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v2c-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/v2c-get.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

Some files were not shown because too many files have changed in this diff Show More