summaryrefslogtreecommitdiff
path: root/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py')
-rw-r--r--examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py b/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py
index 6215d5a0..ea204f2c 100644
--- a/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py
+++ b/examples/v3arch/asyncore/agent/ntforg/send-notification-over-ipv4-and-ipv6.py
@@ -70,22 +70,28 @@ config.addVacmUser(snmpEngine, 2, 'my-area', 'noAuthNoPriv', (), (), (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,1,0), v2c.OctetString('Example Notificator')),
- ((1,3,6,1,2,1,1,5,0), v2c.OctetString('Notificator Example')) )
+ # instance Index
+ None,
+ # additional var-binds: ( (oid, value), ... )
+ [ ((1,3,6,1,2,1,1,1,0), v2c.OctetString('Example Notificator')),
+ ((1,3,6,1,2,1,1,5,0), v2c.OctetString('Notificator Example')) ]
)
print('Notification is scheduled to be sent')