summaryrefslogtreecommitdiff
path: root/examples/v3arch
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2018-06-30 20:14:57 +0200
committerGitHub <noreply@github.com>2018-06-30 20:14:57 +0200
commitda4539e34cacdc0bd6ecfba98dc48caecc12b104 (patch)
tree22fdd82dae7dc971a8998d7679d9d6698105116c /examples/v3arch
parentdf6d6a6efd7ec6810feb9edddf369264512612b2 (diff)
downloadpysnmp-git-da4539e34cacdc0bd6ecfba98dc48caecc12b104.tar.gz
Overhaul SMI/MIB instrumentation API (#161)
Overhaul SMI/MIB instrumentation API SMI/MIB managed objects API overhauled for simplicity and flexibility breaking backward compatibility. This change would allow way more control over custom MIB managed objects and also is the prerequisite for asynchronous MIB instrumentation.
Diffstat (limited to 'examples/v3arch')
-rw-r--r--examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py2
-rw-r--r--examples/v3arch/asyncore/agent/cmdrsp/implementing-snmp-table.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py b/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
index 1a03e725..94bdb7de 100644
--- a/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
+++ b/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
@@ -53,7 +53,7 @@ snmpContext = context.SnmpContext(snmpEngine)
# any Managed Objects attached. It supports only GET's and
# always echos request var-binds in response.
class EchoMibInstrumController(instrum.AbstractMibInstrumController):
- def readVars(self, varBinds, acInfo=(None, None)):
+ def readVars(self, *varBinds, **context):
return [(ov[0], v2c.OctetString('You queried OID %s' % ov[0])) for ov in varBinds]
diff --git a/examples/v3arch/asyncore/agent/cmdrsp/implementing-snmp-table.py b/examples/v3arch/asyncore/agent/cmdrsp/implementing-snmp-table.py
index 0e15599a..ea924fc2 100644
--- a/examples/v3arch/asyncore/agent/cmdrsp/implementing-snmp-table.py
+++ b/examples/v3arch/asyncore/agent/cmdrsp/implementing-snmp-table.py
@@ -102,9 +102,9 @@ mibBuilder.exportSymbols(
rowInstanceId = exampleTableEntry.getInstIdFromIndices('example record one')
mibInstrumentation = snmpContext.getMibInstrum()
mibInstrumentation.writeVars(
- ((exampleTableColumn2.name + rowInstanceId, 'my string value'),
- (exampleTableColumn3.name + rowInstanceId, 123456),
- (exampleTableStatus.name + rowInstanceId, 'createAndGo'))
+ (exampleTableColumn2.name + rowInstanceId, 'my string value'),
+ (exampleTableColumn3.name + rowInstanceId, 123456),
+ (exampleTableStatus.name + rowInstanceId, 'createAndGo')
)
# --- end of SNMP table population ---