summaryrefslogtreecommitdiff
path: root/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py')
-rw-r--r--examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py b/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py
index 8d1ca469..facebe34 100644
--- a/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py
+++ b/examples/v3arch/asyncore/agent/ntforg/usm-md5-none.py
@@ -61,21 +61,28 @@ snmpContext = context.SnmpContext(snmpEngine)
ntfOrg = ntforg.NotificationOriginator(snmpContext)
# Error/confirmation receiver
-def cbFun(sendRequestHandle, errorIndication, cbCtx):
+def cbFun(snmpEngine, sendRequestHandle, errorIndication,
+ errorStatus, errorIndex, varBinds, cbCtx):
print('Notification %s, status - %s' % (
sendRequestHandle, errorIndication and errorIndication or 'delivered'
)
)
# Build and submit notification message to dispatcher
-sendRequestHandle = ntfOrg.sendNotification(
+sendRequestHandle = ntfOrg.sendVarBinds(
snmpEngine,
# Notification targets
'my-notification',
- # Trap OID (SNMPv2-MIB::coldStart)
+ # SNMP Context
+ snmpContext,
+ # contextName
+ '',
+ # notification name (SNMPv2-MIB::coldStart)
(1,3,6,1,6,3,1,1,5,1),
- # ( (oid, value), ... )
- ( ((1,3,6,1,2,1,1,5,0), v2c.OctetString('system name')), ),
+ # instance Index
+ None,
+ # additional var-binds: ( (oid, value), ... )
+ [ ((1,3,6,1,2,1,1,5,0), v2c.OctetString('system name')) ],
cbFun
)