diff options
Diffstat (limited to 'examples/v3arch/asyncore/agent/cmdrsp/multiple-snmp-communities.py')
-rw-r--r-- | examples/v3arch/asyncore/agent/cmdrsp/multiple-snmp-communities.py | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/examples/v3arch/asyncore/agent/cmdrsp/multiple-snmp-communities.py b/examples/v3arch/asyncore/agent/cmdrsp/multiple-snmp-communities.py index d7e3a4d0..5780025f 100644 --- a/examples/v3arch/asyncore/agent/cmdrsp/multiple-snmp-communities.py +++ b/examples/v3arch/asyncore/agent/cmdrsp/multiple-snmp-communities.py @@ -1,19 +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 -# -# 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 ++++++++++++++++++++++++++ + +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 + +Allow read/write access to all objects in the same MIB subtree. + +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" + +"""# from pysnmp.entity import engine, config from pysnmp.entity.rfc3413 import cmdrsp, context from pysnmp.carrier.asyncore.dgram import udp |