diff options
author | elie <elie> | 2005-10-14 14:30:46 +0000 |
---|---|---|
committer | elie <elie> | 2005-10-14 14:30:46 +0000 |
commit | 07e8829d03317d3fabd1a75daadeba024d73ff9d (patch) | |
tree | 062aff55a4637935482814ebff9051f0ee4982ee | |
parent | 377349856b9bc0ac00799ecd72518edf7ff43d33 (diff) | |
download | pysnmp-07e8829d03317d3fabd1a75daadeba024d73ff9d.tar.gz |
* use SET PDU for Set Command Generator example
* pretty print Agent response
-rw-r--r-- | examples/v1arch/manager/setgen.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/v1arch/manager/setgen.py b/examples/v1arch/manager/setgen.py index 7ba69cb..4cb1aa2 100644 --- a/examples/v1arch/manager/setgen.py +++ b/examples/v1arch/manager/setgen.py @@ -9,13 +9,13 @@ from time import time pMod = api.protoModules[api.protoVersion1] # Build PDU -reqPDU = pMod.GetRequestPDU() +reqPDU = pMod.SetRequestPDU() pMod.apiPDU.setDefaults(reqPDU) pMod.apiPDU.setVarBinds( reqPDU, # A list of Var-Binds to SET - (((1,3,6,1,2,1,1,1,0), pMod.Integer(123456)), - ((1,3,6,1,2,1,1,2,0), pMod.IpAddress('127.0.0.1'))) + (((1,3,6,1,2,1,1,1,0), pMod.OctetString('New system description')), + ((1,3,6,1,2,1,1,3,0), pMod.TimeTicks(12))) ) # Build message @@ -38,10 +38,10 @@ def cbRecvFun(transportDispatcher, transportDomain, transportAddress, # Check for SNMP errors reported errorStatus = pMod.apiPDU.getErrorStatus(rspPDU) if errorStatus: - print 'Error: ', errorStatus + print errorStatus.prettyOut(errorStatus) else: for oid, val in pMod.apiPDU.getVarBinds(rspPDU): - print oid, val + print oid, val.prettyOut(val) transportDispatcher.jobFinished(1) return wholeMsg |