Add `hlapi.v1arch` API (#186)

* Add `hlapi.v1arch` API

Introduce new sub-package `pysnmp.hlapi.v1arch` which
wraps otherwise very detailed packet-level SNMP
messaging into a handful of convenience functions.

As a side effect, the `pysnmp.hlapi.*` sub-packages
moved under `pysnmp.hlapi.v3arch` though `pysnmp.hlapi`
still exposes `pysnmp.hlappi.v3arch.*` symbols to
retain some degree of backward compatibility.

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.

* Add v1arch docs and reshuffle hlapi docs
none-community-index
Ilya Etingof 2018-08-12 17:22:58 +02:00 committed by GitHub
parent 488ec26798
commit ac0b956d00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
267 changed files with 5997 additions and 1356 deletions

View File

@ -26,6 +26,25 @@ Revision 5.0.0, released 2018-09-??
user-supplied `cbCtx` object throughout the MIB instrumentation user-supplied `cbCtx` object throughout the MIB instrumentation
methods. The goal is to let MIB objects access/modify whatever methods. The goal is to let MIB objects access/modify whatever
custom Python objects they need while being called back. custom Python objects they need while being called back.
- 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.6, released 2018-09-XX Revision 4.4.6, released 2018-09-XX
----------------------------------- -----------------------------------

View File

@ -3,44 +3,40 @@ Library reference
================= =================
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 3
Dealing with many SNMP features may quickly overwhelm developers who aim at a Dealing with many SNMP features may quickly overwhelm developers who aim at a
quick and trivial task, PySNMP employs a layered architecture approach quick and trivial task, PySNMP employs a layered architecture approach
where the topmost programming API tries to be as simple as possible where the topmost programming API tries to be as simple as possible
to allow immediate solutions for most common use cases. 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 Most of SNMP operations involve packet exchange over network. PySNMP
is shipped with a set of bindings to popular asynchronous Python I/O 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 frameworks that let you run PySNMP in parallel with other tasks your
application may perform. application may perform.
Synchronous SNMP High-level, v3arch, sync
---------------- ------------------------
Most simple and strightforward way to use PySNMP is by employing its The synchronous `hlapi.v3arch` API is the easiest to use and probably
Synchronous, blocking API. It's also the default API offered by the richest in features. However `hlapi.v1arch` API may be faster.
users on *pysnmp.hlapi* sub-package import.
Command Generator Command Generator
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/docs/hlapi/asyncore/sync/manager/cmdgen/getcmd /docs/hlapi/v3arch/asyncore/sync/manager/cmdgen/getcmd
/docs/hlapi/asyncore/sync/manager/cmdgen/setcmd /docs/hlapi/v3arch/asyncore/sync/manager/cmdgen/setcmd
/docs/hlapi/asyncore/sync/manager/cmdgen/nextcmd /docs/hlapi/v3arch/asyncore/sync/manager/cmdgen/nextcmd
/docs/hlapi/asyncore/sync/manager/cmdgen/bulkcmd /docs/hlapi/v3arch/asyncore/sync/manager/cmdgen/bulkcmd
Notification Originator Notification Originator
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/docs/hlapi/asyncore/sync/agent/ntforg/notification /docs/hlapi/v3arch/asyncore/sync/agent/ntforg/notification
Transport configuration Transport configuration
+++++++++++++++++++++++ +++++++++++++++++++++++
@ -59,8 +55,8 @@ saves its configuration for the lifetime of SNMP engine object.
.. autoclass:: pysnmp.hlapi.Udp6TransportTarget .. autoclass:: pysnmp.hlapi.Udp6TransportTarget
:members: setLocalAddress :members: setLocalAddress
Asynchronous: asyncore High-level v3arch asyncore
---------------------- --------------------------
The :mod:`asyncore` module is in Python standard library since ancient The :mod:`asyncore` module is in Python standard library since ancient
times. Main loop is built around :mod:`select` dispatcher, user times. Main loop is built around :mod:`select` dispatcher, user
@ -71,17 +67,17 @@ Command Generator
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/docs/hlapi/asyncore/manager/cmdgen/getcmd /docs/hlapi/v3arch/asyncore/manager/cmdgen/getcmd
/docs/hlapi/asyncore/manager/cmdgen/setcmd /docs/hlapi/v3arch/asyncore/manager/cmdgen/setcmd
/docs/hlapi/asyncore/manager/cmdgen/nextcmd /docs/hlapi/v3arch/asyncore/manager/cmdgen/nextcmd
/docs/hlapi/asyncore/manager/cmdgen/bulkcmd /docs/hlapi/v3arch/asyncore/manager/cmdgen/bulkcmd
Notification Originator Notification Originator
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/docs/hlapi/asyncore/agent/ntforg/notification /docs/hlapi/v3arch/asyncore/agent/ntforg/notification
Transport configuration Transport configuration
+++++++++++++++++++++++ +++++++++++++++++++++++
@ -89,14 +85,14 @@ Transport configuration
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
.. autoclass:: pysnmp.hlapi.asyncore.UdpTransportTarget .. autoclass:: pysnmp.hlapi.v3arch.asyncore.UdpTransportTarget
:members: setLocalAddress :members: setLocalAddress
.. autoclass:: pysnmp.hlapi.asyncore.Udp6TransportTarget .. autoclass:: pysnmp.hlapi.v3arch.asyncore.Udp6TransportTarget
:members: setLocalAddress :members: setLocalAddress
Asynchronous: asyncio High-level v3arch asyncio
--------------------- -------------------------
The :mod:`asyncio` module first appeared in standard library since The :mod:`asyncio` module first appeared in standard library since
Python 3.3 (in provisional basis). Its main design feature is that Python 3.3 (in provisional basis). Its main design feature is that
@ -108,17 +104,17 @@ Command Generator
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/docs/hlapi/asyncio/manager/cmdgen/getcmd /docs/hlapi/v3arch/asyncio/manager/cmdgen/getcmd
/docs/hlapi/asyncio/manager/cmdgen/setcmd /docs/hlapi/v3arch/asyncio/manager/cmdgen/setcmd
/docs/hlapi/asyncio/manager/cmdgen/nextcmd /docs/hlapi/v3arch/asyncio/manager/cmdgen/nextcmd
/docs/hlapi/asyncio/manager/cmdgen/bulkcmd /docs/hlapi/v3arch/asyncio/manager/cmdgen/bulkcmd
Notification Originator Notification Originator
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/docs/hlapi/asyncio/agent/ntforg/notification /docs/hlapi/v3arch/asyncio/agent/ntforg/notification
Transport configuration Transport configuration
+++++++++++++++++++++++ +++++++++++++++++++++++
@ -126,14 +122,14 @@ Transport configuration
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
.. autoclass:: pysnmp.hlapi.asyncio.UdpTransportTarget .. autoclass:: pysnmp.hlapi.v3arch.asyncio.UdpTransportTarget
:members: setLocalAddress :members: setLocalAddress
.. autoclass:: pysnmp.hlapi.asyncio.Udp6TransportTarget .. autoclass:: pysnmp.hlapi.v3arch.asyncio.Udp6TransportTarget
:members: setLocalAddress :members: setLocalAddress
Asynchronous: trollius High-level v3arch trollius
---------------------- --------------------------
An almost compatible alternative to *asyncio* for pre-3.3 Python An almost compatible alternative to *asyncio* for pre-3.3 Python
is `Trollius <http://trollius.readthedocs.org>`_ module. PySNMP's is `Trollius <http://trollius.readthedocs.org>`_ module. PySNMP's
@ -142,8 +138,8 @@ is `Trollius <http://trollius.readthedocs.org>`_ module. PySNMP's
Please refer to :doc:`Trollius examples </examples/contents>` for Please refer to :doc:`Trollius examples </examples/contents>` for
more information. more information.
Asynchronous: Twisted High-level v3arch twisted
--------------------- -------------------------
`Twisted <http://twistedmatrix.org>`_ is one of the earliest and hugely `Twisted <http://twistedmatrix.org>`_ is one of the earliest and hugely
popular asynchronous I/O framework. It introduced a concept of popular asynchronous I/O framework. It introduced a concept of
@ -156,17 +152,17 @@ Command Generator
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/docs/hlapi/twisted/manager/cmdgen/getcmd /docs/hlapi/v3arch/twisted/manager/cmdgen/getcmd
/docs/hlapi/twisted/manager/cmdgen/setcmd /docs/hlapi/v3arch/twisted/manager/cmdgen/setcmd
/docs/hlapi/twisted/manager/cmdgen/nextcmd /docs/hlapi/v3arch/twisted/manager/cmdgen/nextcmd
/docs/hlapi/twisted/manager/cmdgen/bulkcmd /docs/hlapi/v3arch/twisted/manager/cmdgen/bulkcmd
Notification Originator Notification Originator
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/docs/hlapi/twisted/agent/ntforg/notification /docs/hlapi/v3arch/twisted/agent/ntforg/notification
Transport configuration Transport configuration
+++++++++++++++++++++++ +++++++++++++++++++++++
@ -174,14 +170,14 @@ Transport configuration
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
.. autoclass:: pysnmp.hlapi.twisted.UdpTransportTarget .. autoclass:: pysnmp.hlapi.v3arch.twisted.UdpTransportTarget
:members: setLocalAddress :members: setLocalAddress
SNMP Engine High-level v3arch SNMP Engine
----------- -----------------------------
SNMP Engine is a central, stateful object used by all SNMP v3 SNMP Engine is a central, stateful object used by all SNMP v3
substsems. Calls to high-level Applications API also consume SNMP subsystems. Calls to high-level Applications API also consume SNMP
Engine object on input. Engine object on input.
.. toctree:: .. toctree::
@ -189,8 +185,8 @@ Engine object on input.
.. autoclass:: pysnmp.hlapi.SnmpEngine(snmpEngineID=None) .. autoclass:: pysnmp.hlapi.SnmpEngine(snmpEngineID=None)
Security Parameters High-level v3arch auth
------------------- ----------------------
Calls to high-level Applications API consume Security Parameters Calls to high-level Applications API consume Security Parameters
configuration object on input. The shortcut classes described in configuration object on input. The shortcut classes described in
@ -242,8 +238,8 @@ via constant OIDs:
Transport configuration is I/O framework specific and is described in Transport configuration is I/O framework specific and is described in
respective sections. respective sections.
SNMP Context High-level v3arch SNMP Context
------------ ------------------------------
SNMP engine may serve several instances of the same MIB within SNMP engine may serve several instances of the same MIB within
possibly multiple SNMP entities. SNMP context is a tool for possibly multiple SNMP entities. SNMP context is a tool for
@ -274,6 +270,111 @@ SNMP engine. See :RFC:`3411#section-3.3.1` for details.
.. autoclass:: pysnmp.hlapi.ContextData .. autoclass:: pysnmp.hlapi.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)
.. _mib-services: .. _mib-services:
MIB services MIB services

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 By default PySNMP will search your local filesystem for ASN.1 MIB files
you refer to. It can also be configured to automatically download you refer to. It can also be configured to automatically download
them from remote hosts, as them from remote hosts, as
:doc:`shown </examples/hlapi/asyncore/sync/manager/cmdgen/mib-tweaks>` :doc:`shown </examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/mib-tweaks>`
in the examples. We maintain a in the examples. We maintain a
`collection <http://mibs.snmplabs.com/asn1/>`_ of ASN.1 MIB modules `collection <http://mibs.snmplabs.com/asn1/>`_ of ASN.1 MIB modules
that you can use in your SNMP projects. that you can use in your SNMP projects.

View File

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

View File

@ -50,6 +50,7 @@ operational:
MIB download and compilation. That helps visualizing more SNMP objects MIB download and compilation. That helps visualizing more SNMP objects
Optional: Optional:
* `pysnmpcrypto <https://pypi.org/project/pysnmpcrypto/>`_, * `pysnmpcrypto <https://pypi.org/project/pysnmpcrypto/>`_,
for strong SNMPv3 crypto support for strong SNMPv3 crypto support

View File

@ -9,51 +9,82 @@ SNMP is not simple (PySNMP implementation takes over 15K lines of
Python code), but PySNMP tries to hide the complexities and let you Python code), but PySNMP tries to hide the complexities and let you
carry out typical SNMP operations in a quick and intuitive way. carry out typical SNMP operations in a quick and intuitive way.
PySNMP offers three groups of programming interfaces to deal with PySNMP offers high and low-level programming interfaces to deal with
SNMP protocol. In the order from most concise to most detailed those SNMP protocol.
APIs follow.
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.
High-level SNMP High-level SNMP
--------------- ---------------
The so called high-level API (hlapi) is designed to be simple, concise and The high-level API (`hlapi`) is designed to be simple, concise and
suitable for the most frequent operations. For that matter only suitable for the most typical client-side operations. For that matter,
Command Generator and Notification Originator Applications are currently only Command Generator and Notification Originator Applications are
wrapped into a nearly one-line Python expression. wrapped into a nearly one-line Python expression.
It comes in several flavours: one synchronous and a bunch of bindings to The `hlapi` interfaces come in several flavours: one synchronous
popular asynchronous I/O frameworks. Those varieties of APIs bring and a bunch of asynchronous, adapted to work withing the event loops
subtile differences, mostly to better match particular I/O framework of popular asynchronous I/O frameworks.
customs. Unless you have a very specific task, the high-level API might
solve your SNMP needs. 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
+++++++++++++++++++
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/examples/hlapi/asyncore/sync/contents /examples/hlapi/v3arch/asyncore/sync/contents
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/examples/hlapi/asyncore/contents /examples/hlapi/v3arch/asyncore/contents
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/examples/hlapi/asyncio/contents /examples/hlapi/v3arch/asyncio/contents
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/examples/hlapi/trollius/contents /examples/hlapi/v3arch/trollius/contents
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
/examples/hlapi/twisted/contents /examples/hlapi/v3arch/twisted/contents
Native SNMP API The v1 architecture
--------------- +++++++++++++++++++
.. toctree::
:maxdepth: 2
/examples/hlapi/v1arch/asyncore/sync/contents
.. toctree::
:maxdepth: 2
/examples/hlapi/v1arch/asyncore/contents
Low-level v3 architecture
-------------------------
Complete implementation of all official Standard SNMP Applications. It Complete implementation of all official Standard SNMP Applications. It
should let you implement any SNMP operation defined in the standard should let you implement any SNMP operation defined in the standard
@ -70,8 +101,8 @@ framework being used.
/examples/v3arch/trollius/contents /examples/v3arch/trollius/contents
/examples/v3arch/twisted/contents /examples/v3arch/twisted/contents
Packet-level SNMP Low-level v1 architecture
----------------- -------------------------
In cases where performance is your top priority and you only need to 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 work with SNMP v1 and v2c systems and you do not mind writing much
@ -116,15 +147,14 @@ Notification Receiver
/examples/v1arch/asyncore/manager/ntfrcv/transport-tweaks /examples/v1arch/asyncore/manager/ntfrcv/transport-tweaks
Low-level MIB access Low-level SMI/MIB
-------------------- -----------------
.. toctree:: .. toctree::
/examples/smi/manager/browsing-mib-tree /examples/smi/manager/browsing-mib-tree
/examples/smi/agent/implementing-mib-objects /examples/smi/agent/implementing-mib-objects
Using these examples Using these examples
-------------------- --------------------

View File

@ -1,17 +0,0 @@
.. 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

@ -1,17 +0,0 @@
.. 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,29 +0,0 @@
.. 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

@ -1,29 +0,0 @@
.. 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

@ -1,17 +0,0 @@
.. 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

@ -1,40 +0,0 @@
.. 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

@ -1,17 +0,0 @@
.. 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,40 +0,0 @@
.. 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

@ -1,29 +0,0 @@
.. 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

@ -1,18 +0,0 @@
.. 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

@ -1,28 +0,0 @@
.. 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

@ -1,49 +0,0 @@
.. 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

@ -1,29 +0,0 @@
.. 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

@ -1,29 +0,0 @@
.. 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,84 +0,0 @@
.. 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

@ -1,48 +0,0 @@
.. 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

@ -1,30 +0,0 @@
.. 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

@ -1,72 +0,0 @@
.. 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

@ -1,29 +0,0 @@
.. 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

@ -1,18 +0,0 @@
.. 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

@ -1,17 +0,0 @@
.. 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,29 +0,0 @@
.. 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

@ -1,17 +0,0 @@
.. 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

@ -1,17 +0,0 @@
.. 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

@ -1,27 +0,0 @@
.. 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,29 +0,0 @@
.. 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

@ -1,29 +0,0 @@
.. 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

@ -1,17 +0,0 @@
.. 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

@ -1,27 +0,0 @@
.. 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

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

View File

@ -0,0 +1,49 @@
.. 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

@ -0,0 +1,18 @@
.. 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

@ -0,0 +1,60 @@
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

@ -0,0 +1,39 @@
.. 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

@ -0,0 +1,48 @@
.. 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

@ -0,0 +1,30 @@
.. 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

@ -0,0 +1,30 @@
.. 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

@ -0,0 +1,50 @@
.. 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

@ -0,0 +1,29 @@
.. 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

@ -0,0 +1,18 @@
.. 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

@ -0,0 +1,59 @@
.. 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

@ -0,0 +1,17 @@
.. 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

@ -0,0 +1,74 @@
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

@ -0,0 +1,39 @@
.. 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

@ -0,0 +1,48 @@
.. 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

@ -0,0 +1,30 @@
.. 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

@ -0,0 +1,29 @@
.. 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>`.

View File

@ -0,0 +1,50 @@
.. 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

@ -0,0 +1,29 @@
.. 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

@ -0,0 +1,18 @@
.. 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

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

View File

@ -1,6 +1,6 @@
Asynchronous: asyncio Asynchronous SNMP (asynio, v3arch)
===================== ==================================
The :mod:`asyncio` module first appeared in standard library since The :mod:`asyncio` module first appeared in standard library since
Python 3.3 (in provisional basis). Its main design feature is that it 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". "callback hell".
With `asyncio` built-in facilities, you could run many SNMP queries With `asyncio` built-in facilities, you could run many SNMP queries
in parallel and/or sequentially, interleave SNMP queries with I/O in parallel and/or sequentially, interleave SNMP queries with other I/O
operations with other systems. See `asyncio resources <http://asyncio.org>`_ operations. See `asyncio resources <http://asyncio.org>`_
repository for other `asyncio`-compatible modules. repository for other `asyncio`-compatible modules.
In most examples approximate analogues of well known Net-SNMP snmp* tools 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: Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/v1-get.py .. include:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/v1-get.py
:start-after: options: :start-after: options:
:end-before: Functionally :end-before: Functionally
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/v1-get.py .. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/v1-get.py
:start-after: """# :start-after: """#
:language: python :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 SNMP GETNEXT operations effectively fetching a table of SNMP variables
from SNMP Agent: from SNMP Agent:
.. include:: /../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py .. include:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: options: :start-after: options:
:end-before: Functionally :end-before: Functionally
.. literalinclude:: /../../examples/hlapi/asyncio/manager/cmdgen/getbulk-to-eom.py .. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """# :start-after: """#
:language: python :language: python
@ -42,18 +42,18 @@ More examples on Command Generator API usage follow.
.. toctree:: .. toctree::
/examples/hlapi/asyncio/manager/cmdgen/snmp-versions /examples/hlapi/v3arch/asyncio/manager/cmdgen/snmp-versions
/examples/hlapi/asyncio/manager/cmdgen/walking-operations /examples/hlapi/v3arch/asyncio/manager/cmdgen/walking-operations
/examples/hlapi/asyncio/manager/cmdgen/advanced-topics /examples/hlapi/v3arch/asyncio/manager/cmdgen/advanced-topics
Sending SNMP TRAP's and INFORM's is as easy with PySNMP library. Sending SNMP TRAP's and INFORM's is as easy with PySNMP library.
The following code sends SNMP TRAP: The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py .. include:: /../../examples/hlapi/v3arch/asyncio/agent/ntforg/default-v1-trap.py
:start-after: options: :start-after: options:
:end-before: Functionally :end-before: Functionally
.. literalinclude:: /../../examples/hlapi/asyncio/agent/ntforg/default-v1-trap.py .. literalinclude:: /../../examples/hlapi/v3arch/asyncio/agent/ntforg/default-v1-trap.py
:start-after: """# :start-after: """#
:language: python :language: python
@ -61,8 +61,8 @@ More examples on Notification Originator API usage follow.
.. toctree:: .. toctree::
/examples/hlapi/asyncio/agent/ntforg/common-notifications /examples/hlapi/v3arch/asyncio/agent/ntforg/common-notifications
/examples/hlapi/asyncio/agent/ntforg/advanced-topics /examples/hlapi/v3arch/asyncio/agent/ntforg/advanced-topics
More sophisticated or less popular SNMP operations can still be performed More sophisticated or less popular SNMP operations can still be performed
with PySNMP through its Native API to Standard SNMP Applications. 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/v3arch/asyncio/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncio/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py>` script.
.. include:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/multiple-sequential-queries.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/multiple-sequential-queries.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/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/v3arch/asyncio/manager/cmdgen/v1-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/v1-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncio/manager/cmdgen/v1-get.py>` script.
.. include:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/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/v3arch/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncio/manager/cmdgen/getbulk-to-eom.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/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/v3arch/asyncore/agent/ntforg/multiple-traps-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/multiple-traps-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncore/agent/ntforg/multiple-traps-at-once.py>` script.
.. include:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/multiple-informs-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/multiple-informs-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncore/agent/ntforg/multiple-informs-at-once.py>` script.
.. include:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/running-multiple-snmp-engines-at-once.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/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/v3arch/asyncore/agent/ntforg/default-v1-trap.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/default-v1-trap.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncore/agent/ntforg/default-v1-trap.py>` script.
See also: :doc:`library reference </docs/api-reference>`.

View File

@ -1,22 +1,30 @@
Asynchronous: asyncore Asynchronous SNMP (asyncore, v3arch)
====================== ====================================
With :mod:`asyncore` API your scripts get CPU time on :mod:`socket` With :mod:`asyncore` API your scripts get CPU time on :mod:`socket`
events being watched for by :mod:`select` dispatcher. Your code events being watched for by :mod:`select` dispatcher. Your code
live mostly in isolated functions (or any callable objects). 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 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 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 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: Here's a quick example on a simple SNMP GET by high-level API:
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/v2c-get.py .. include:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/v2c-get.py
:start-after: options: :start-after: options:
:end-before: Functionally :end-before: Functionally
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/v2c-get.py .. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/v2c-get.py
:start-after: """# :start-after: """#
:language: python :language: python
@ -24,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 SNMP GETNEXT operations effectively fetching a table of SNMP variables
from SNMP Agent: from SNMP Agent:
.. include:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py .. include:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: options: :start-after: options:
:end-before: Functionally :end-before: Functionally
.. literalinclude:: /../../examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py .. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """# :start-after: """#
:language: python :language: python
@ -36,18 +44,18 @@ More examples on Command Generator API usage follow.
.. toctree:: .. toctree::
/examples/hlapi/asyncore/manager/cmdgen/snmp-versions /examples/hlapi/v3arch/asyncore/manager/cmdgen/snmp-versions
/examples/hlapi/asyncore/manager/cmdgen/walking-operations /examples/hlapi/v3arch/asyncore/manager/cmdgen/walking-operations
/examples/hlapi/asyncore/manager/cmdgen/advanced-topics /examples/hlapi/v3arch/asyncore/manager/cmdgen/advanced-topics
Sending SNMP TRAP's and INFORM's is as easy with PySNMP library. Sending SNMP TRAP's and INFORM's is as easy with PySNMP library.
The following code sends SNMP TRAP: The following code sends SNMP TRAP:
.. include:: /../../examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py .. include:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/default-v1-trap.py
:start-after: options: :start-after: options:
:end-before: Functionally :end-before: Functionally
.. literalinclude:: /../../examples/hlapi/asyncore/agent/ntforg/default-v1-trap.py .. literalinclude:: /../../examples/hlapi/v3arch/asyncore/agent/ntforg/default-v1-trap.py
:start-after: """# :start-after: """#
:language: python :language: python
@ -55,8 +63,8 @@ More examples on Notification Originator API usage follow.
.. toctree:: .. toctree::
/examples/hlapi/asyncore/agent/ntforg/common-notifications /examples/hlapi/v3arch/asyncore/agent/ntforg/common-notifications
/examples/hlapi/asyncore/agent/ntforg/advanced-topics /examples/hlapi/v3arch/asyncore/agent/ntforg/advanced-topics
More sophisticated or less popular SNMP operations can still be performed More sophisticated or less popular SNMP operations can still be performed
with PySNMP through its Native API to Standard SNMP Applications. 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/v3arch/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once-over-ipv4-and-ipv6.py>` script.
.. include:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/query-multiple-snmp-engines-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/query-multiple-snmp-engines-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncore/manager/cmdgen/query-multiple-snmp-engines-over-ipv4-and-ipv6.py>` script.
.. include:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/multiple-concurrent-queries-over-ipv4-and-ipv6.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/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/v3arch/asyncore/manager/cmdgen/v2c-get.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/v2c-get.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncore/manager/cmdgen/v2c-get.py>` script.
.. include:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/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/v3arch/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/manager/cmdgen/pull-whole-mib.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/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/v3arch/asyncore/sync/agent/ntforg/custom-contextname.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/sync/agent/ntforg/custom-contextname.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncore/sync/agent/ntforg/custom-contextname.py>` script.
.. include:: /../../examples/hlapi/v3arch/asyncore/sync/agent/ntforg/custom-contextengineid.py
:start-after: """
:end-before: """#
.. literalinclude:: /../../examples/hlapi/v3arch/asyncore/sync/agent/ntforg/custom-contextengineid.py
:start-after: """#
:language: python
:download:`Download</../../examples/hlapi/v3arch/asyncore/sync/agent/ntforg/custom-contextengineid.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