summaryrefslogtreecommitdiff
path: root/examples/v3arch/asyncore/agent/ntforg/v3-trap.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/v3arch/asyncore/agent/ntforg/v3-trap.py')
-rw-r--r--examples/v3arch/asyncore/agent/ntforg/v3-trap.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/examples/v3arch/asyncore/agent/ntforg/v3-trap.py b/examples/v3arch/asyncore/agent/ntforg/v3-trap.py
index d53ac598..bff341a3 100644
--- a/examples/v3arch/asyncore/agent/ntforg/v3-trap.py
+++ b/examples/v3arch/asyncore/agent/ntforg/v3-trap.py
@@ -59,21 +59,27 @@ config.addVacmUser(snmpEngine, 3, 'usr-md5-des', 'authPriv', (), (), (1,3,6))
# *** SNMP engine configuration is complete by this line ***
-# Create default SNMP context where contextEngineId == SnmpEngineId
+# Create Notification Originator App instance.
+ntfOrg = ntforg.NotificationOriginator()
+
+ # Create default SNMP context where contextEngineId == SnmpEngineId
snmpContext = context.SnmpContext(snmpEngine)
-# Create Notification Originator App instance.
-ntfOrg = ntforg.NotificationOriginator(snmpContext)
-
# Build and submit notification message to dispatcher
-ntfOrg.sendNotification(
+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')) ]
)
print('Notification is scheduled to be sent')