summaryrefslogtreecommitdiff
path: root/examples/v3arch/twisted/agent/cmdrsp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/v3arch/twisted/agent/cmdrsp')
-rw-r--r--examples/v3arch/twisted/agent/cmdrsp/v1-read-and-write-communities.py36
-rw-r--r--examples/v3arch/twisted/agent/cmdrsp/v2c-custom-scalar-mib-objects.py36
-rw-r--r--examples/v3arch/twisted/agent/cmdrsp/v2c-multiple-interfaces.py36
-rw-r--r--examples/v3arch/twisted/agent/cmdrsp/v3-multiple-users.py43
4 files changed, 80 insertions, 71 deletions
diff --git a/examples/v3arch/twisted/agent/cmdrsp/v1-read-and-write-communities.py b/examples/v3arch/twisted/agent/cmdrsp/v1-read-and-write-communities.py
index d346244..da6cc5f 100644
--- a/examples/v3arch/twisted/agent/cmdrsp/v1-read-and-write-communities.py
+++ b/examples/v3arch/twisted/agent/cmdrsp/v1-read-and-write-communities.py
@@ -1,20 +1,22 @@
-#
-# Command Responder
-#
-# Listen and respond to SNMP GET/SET/GETNEXT queries with
-# the following options:
-#
-# * SNMPv1
-# * with SNMP community "public" (read access) or "private" (write access)
-# * allow access to SNMPv2-MIB objects (1.3.6.1.2.1)
-# * over IPv4/UDP, listening at 127.0.0.1:161
-# * using Twisted fraework for network transport
-#
-# The following Net-SNMP's commands will GET/SET a value at this Agent:
-#
-# $ snmpget -v1 -c public 127.0.0.1 SNMPv2-MIB::sysLocation.0
-# $ snmpset -v1 -c private 127.0.0.1 SNMPv2-MIB::sysLocation.0 s "far away"
-#
+"""
+Multiple SNMP communities
++++++++++++++++++++++++++
+
+Listen and respond to SNMP GET/SET/GETNEXT queries with
+the following options:
+
+* SNMPv1
+* with SNMP community "public" (read access) or "private" (write access)
+* allow access to SNMPv2-MIB objects (1.3.6.1.2.1)
+* over IPv4/UDP, listening at 127.0.0.1:161
+* using Twisted fraework for network transport
+
+The following Net-SNMP commands will GET/SET a value at this Agent:
+
+| $ snmpget -v1 -c public 127.0.0.1 SNMPv2-MIB::sysLocation.0
+| $ snmpset -v1 -c private 127.0.0.1 SNMPv2-MIB::sysLocation.0 s "far away"
+
+"""#
from twisted.internet import reactor
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
diff --git a/examples/v3arch/twisted/agent/cmdrsp/v2c-custom-scalar-mib-objects.py b/examples/v3arch/twisted/agent/cmdrsp/v2c-custom-scalar-mib-objects.py
index 091bb75..565419d 100644
--- a/examples/v3arch/twisted/agent/cmdrsp/v2c-custom-scalar-mib-objects.py
+++ b/examples/v3arch/twisted/agent/cmdrsp/v2c-custom-scalar-mib-objects.py
@@ -1,20 +1,22 @@
-#
-# Command Responder
-#
-# Listen and respond to SNMP GET/SET/GETNEXT/GETBULK queries with
-# the following options:
-#
-# * SNMPv2c
-# * with SNMP community "public"
-# * serving custom Managed Object Instance defined within this script
-# * allow read access only to the subtree where the custom MIB object resides
-# * over IPv4/UDP, listening at 127.0.0.1:161
-# * using Twisted fraework for network transport
-#
-# Either of the following Net-SNMP's commands will walk this Agent:
-#
-# $ snmpwalk -v2c -c public 127.0.0.1 .1.3.6
-#
+"""
+Implementing scalar MIB objects
++++++++++++++++++++++++++++++++
+
+Listen and respond to SNMP GET/SET/GETNEXT/GETBULK queries with
+the following options:
+
+* SNMPv2c
+* with SNMP community "public"
+* serving custom Managed Object Instance defined within this script
+* allow read access only to the subtree where the custom MIB object resides
+* over IPv4/UDP, listening at 127.0.0.1:161
+* using Twisted fraework for network transport
+
+Either of the following Net-SNMP commands will walk this Agent:
+
+| $ snmpwalk -v2c -c public 127.0.0.1 .1.3.6
+
+"""#
import sys
from twisted.internet import reactor
from pysnmp.entity import engine, config
diff --git a/examples/v3arch/twisted/agent/cmdrsp/v2c-multiple-interfaces.py b/examples/v3arch/twisted/agent/cmdrsp/v2c-multiple-interfaces.py
index 4f8b29d..a9e3e00 100644
--- a/examples/v3arch/twisted/agent/cmdrsp/v2c-multiple-interfaces.py
+++ b/examples/v3arch/twisted/agent/cmdrsp/v2c-multiple-interfaces.py
@@ -1,20 +1,22 @@
-#
-# Command Responder
-#
-# Listen and respond to SNMP GET/SET/GETNEXT/GETBULK queries with
-# the following options:
-#
-# * SNMPv2c
-# * with SNMP community "public"
-# * allow access to SNMPv2-MIB objects (1.3.6.1.2.1)
-# * over IPv4/UDP, listening at 127.0.0.1:161 and 127.0.0.2:161 interfaces
-# * using Twisted framework for network transport
-#
-# Either of the following Net-SNMP's commands will walk this Agent:
-#
-# $ snmpwalk -v2c -c public 127.0.0.1 .1.3.6
-# $ snmpwalk -v2c -c public 127.0.0.2 .1.3.6
-#
+"""
+Listen on multiple network interfaces
++++++++++++++++++++++++++++++++++++++
+
+Listen and respond to SNMP GET/SET/GETNEXT/GETBULK queries with
+the following options:
+
+* SNMPv2c
+* with SNMP community "public"
+* allow access to SNMPv2-MIB objects (1.3.6.1.2.1)
+* over IPv4/UDP, listening at 127.0.0.1:161 and 127.0.0.2:161 interfaces
+* using Twisted framework for network transport
+
+Either of the following Net-SNMP commands will walk this Agent:
+
+| $ snmpwalk -v2c -c public 127.0.0.1 .1.3.6
+| $ snmpwalk -v2c -c public 127.0.0.2 .1.3.6
+
+"""#
from twisted.internet import reactor
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
diff --git a/examples/v3arch/twisted/agent/cmdrsp/v3-multiple-users.py b/examples/v3arch/twisted/agent/cmdrsp/v3-multiple-users.py
index 36d9d36..91fd955 100644
--- a/examples/v3arch/twisted/agent/cmdrsp/v3-multiple-users.py
+++ b/examples/v3arch/twisted/agent/cmdrsp/v3-multiple-users.py
@@ -1,23 +1,26 @@
-#
-# Command Responder
-#
-# Listen and respond to SNMP GET/SET/GETNEXT/GETBULK queries with
-# the following options:
-#
-# * SNMPv3
-# * with USM user 'usr-md5-des', auth: MD5, priv DES or
-# with USM user 'usr-sha-none', auth: SHA, no privacy
-# with USM user 'usr-sha-aes128', auth: SHA, priv AES
-# * allow access to SNMPv2-MIB objects (1.3.6.1.2.1)
-# * over IPv4/UDP, listening at 127.0.0.1:161
-# * using Twisted framework for network transport
-#
-# Either of the following Net-SNMP's commands will walk this Agent:
-#
-# $ snmpwalk -v3 -u usr-md5-des -l authPriv -A authkey1 -X privkey1 localhost .1.3.6
-# $ snmpwalk -v3 -u usr-sha-none -l authNoPriv -a SHA -A authkey1 localhost .1.3.6
-# $ snmpwalk -v3 -u usr-sha-aes128 -l authPriv -a SHA -A authkey1 -x AES -X privkey1 localhost .1.3.6
-#
+"""
+Multiple SNMP USM users
++++++++++++++++++++++++
+
+Listen and respond to SNMP GET/SET/GETNEXT/GETBULK queries with
+the following options:
+
+* SNMPv3
+* with USM user:
+ * 'usr-md5-des', auth: MD5, priv DES or
+ * 'usr-sha-none', auth: SHA, no privacy
+ * 'usr-sha-aes128', auth: SHA, priv AES
+* allow access to SNMPv2-MIB objects (1.3.6.1.2.1)
+* over IPv4/UDP, listening at 127.0.0.1:161
+* using Twisted framework for network transport
+
+Either of the following Net-SNMP commands will walk this Agent:
+
+| $ snmpwalk -v3 -u usr-md5-des -l authPriv -A authkey1 -X privkey1 localhost .1.3.6
+| $ snmpwalk -v3 -u usr-sha-none -l authNoPriv -a SHA -A authkey1 localhost .1.3.6
+| $ snmpwalk -v3 -u usr-sha-aes128 -l authPriv -a SHA -A authkey1 -x AES -X privkey1 localhost .1.3.6
+
+"""#
from twisted.internet import reactor
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context