summaryrefslogtreecommitdiff
path: root/examples/v3arch/asyncore/manager
diff options
context:
space:
mode:
authorelie <elie>2013-09-30 21:10:52 +0000
committerelie <elie>2013-09-30 21:10:52 +0000
commit0f190c6a3817c5d0c4e38430a4e4714aa30063f1 (patch)
treee19fbd27f8726ad2cdd77f317592993f0e789b53 /examples/v3arch/asyncore/manager
parent088bd1af9ba351f1f229fa56c7f7bcc93be68c23 (diff)
downloadpysnmp-git-0f190c6a3817c5d0c4e38430a4e4714aa30063f1.tar.gz
examples adjusted to work with fixed-EngineID SNMP simulator
Diffstat (limited to 'examples/v3arch/asyncore/manager')
-rw-r--r--examples/v3arch/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py11
-rw-r--r--examples/v3arch/asyncore/manager/cmdgen/set-multiple-scalar-values.py2
-rw-r--r--examples/v3arch/asyncore/manager/cmdgen/v2c-set.py2
3 files changed, 8 insertions, 7 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py b/examples/v3arch/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py
index b0ce65cd..7a863d6c 100644
--- a/examples/v3arch/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py
+++ b/examples/v3arch/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py
@@ -3,15 +3,16 @@
#
# Send a SNMP GET request
# with SNMPv3 with user 'usr-md5-none', SHA auth and no privacy protocols
-# for MIB instance identified by contextEngineId: 8000000001020304,
-# contextName: my-context
+# for MIB instance identified by
+# contextEngineId: 0x80004fb805636c6f75644dab22cc,
+# contextName: da761cfc8c94d3aceef4f60f049105ba
# over IPv4/UDP
# to an Agent at 195.218.195.228:161
# for an OID in tuple form
#
# This script performs similar to the following Net-SNMP command:
#
-# $ snmpget -v3 -l authNoPriv -u usr-md5-none -A authkey1 -E 8000000001020304 -n my-context -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.1.0
+# $ snmpget -v3 -l authNoPriv -u usr-md5-none -A authkey1 -E 80004fb805636c6f75644dab22cc -n da761cfc8c94d3aceef4f60f049105ba -ObentU 195.218.195.228:161 1.3.6.1.2.1.1.1.0
#
from pysnmp.entity import engine, config
from pysnmp.carrier.asynsock.dgram import udp
@@ -71,8 +72,8 @@ cmdgen.GetCommandGenerator().sendReq(
'my-router',
( ((1,3,6,1,2,1,1,1,0), None), ),
cbFun,
- contextEngineId=rfc1902.OctetString(hexValue='8000000001020304'),
- contextName=rfc1902.OctetString('my-context')
+ contextEngineId=rfc1902.OctetString(hexValue='80004fb805636c6f75644dab22cc'),
+ contextName=rfc1902.OctetString('da761cfc8c94d3aceef4f60f049105ba')
)
# Run I/O dispatcher which would send pending queries and process responses
diff --git a/examples/v3arch/asyncore/manager/cmdgen/set-multiple-scalar-values.py b/examples/v3arch/asyncore/manager/cmdgen/set-multiple-scalar-values.py
index 20365405..c64b0fe1 100644
--- a/examples/v3arch/asyncore/manager/cmdgen/set-multiple-scalar-values.py
+++ b/examples/v3arch/asyncore/manager/cmdgen/set-multiple-scalar-values.py
@@ -69,7 +69,7 @@ cmdgen.SetCommandGenerator().sendReq(
snmpEngine,
'my-router',
( ((1,3,6,1,2,1,1,9,1,3,1), rfc1902.OctetString('my value')),
- ((1,3,6,1,2,1,1,9,1,4,1), rfc1902.Integer(123)) ),
+ ((1,3,6,1,2,1,1,9,1,4,1), rfc1902.TimeTicks(123)) ),
cbFun
)
diff --git a/examples/v3arch/asyncore/manager/cmdgen/v2c-set.py b/examples/v3arch/asyncore/manager/cmdgen/v2c-set.py
index 5e6cbfc7..d004433f 100644
--- a/examples/v3arch/asyncore/manager/cmdgen/v2c-set.py
+++ b/examples/v3arch/asyncore/manager/cmdgen/v2c-set.py
@@ -66,7 +66,7 @@ def cbFun(sendRequestHandle,
cmdgen.SetCommandGenerator().sendReq(
snmpEngine,
'my-router',
- ( ((1,3,6,1,2,1,1,9,1,4,1), rfc1902.Integer(123)), ),
+ ( ((1,3,6,1,2,1,1,9,1,4,1), rfc1902.TimeTicks(123)), ),
cbFun
)