summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorelie <elie>2014-06-15 12:45:12 +0000
committerelie <elie>2014-06-15 12:45:12 +0000
commitbfd8265873b24d0124bfa23eec615bf4fc85ddad (patch)
tree04a92937bd236e0b834e7d55d886dc0cfc6b33ea /examples
parentfb2b229bfca8464dc9584c3235dd541d7d1859c7 (diff)
downloadpysnmp-git-bfd8265873b24d0124bfa23eec615bf4fc85ddad.tar.gz
echo back an OCTET STRING, not request values
Diffstat (limited to 'examples')
-rw-r--r--examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py b/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
index e78b05d3..bc2d87c5 100644
--- a/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
+++ b/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
@@ -13,7 +13,7 @@
#
# The following Net-SNMP's command will send GET request to this Agent:
#
-# $ snmpget -v3 -u usr-none-none -l noAuthNoPriv -n my-context 127.0.0.1 sysDescr.0
+# $ snmpget -v3 -u usr-none-none -l noAuthNoPriv -n my-context -Ir 127.0.0.1 sysDescr.0
#
from pysnmp.entity import engine, config
from pysnmp.entity.rfc3413 import cmdrsp, context
@@ -51,7 +51,7 @@ snmpContext = context.SnmpContext(snmpEngine)
# always echos request var-binds in response.
class EchoMibInstrumController(instrum.AbstractMibInstrumController):
def readVars(self, vars, acInfo=(None, None)):
- return vars
+ return [ (ov[0], v2c.OctetString('You queried OID %s' % ov[0])) for ov in vars]
# Create a custom Management Instrumentation Controller and register at
# SNMP Context under ContextName 'my-context'