diff options
author | elie <elie> | 2014-06-17 05:46:57 +0000 |
---|---|---|
committer | elie <elie> | 2014-06-17 05:46:57 +0000 |
commit | dad702f69446abcbcf32584743beb47f4583e0cd (patch) | |
tree | dce4559a9651d3cb6e361b1382e15e84fd306836 /examples/v3arch/agent/ntforg/trap-v1-from-specific-address.py | |
parent | 6acd5123d163c9af8d529309842d0e7b6fecc4c4 (diff) | |
download | pysnmp-dad702f69446abcbcf32584743beb47f4583e0cd.tar.gz |
converted to the latest API that supports more data to be used
Diffstat (limited to 'examples/v3arch/agent/ntforg/trap-v1-from-specific-address.py')
-rw-r--r-- | examples/v3arch/agent/ntforg/trap-v1-from-specific-address.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/examples/v3arch/agent/ntforg/trap-v1-from-specific-address.py b/examples/v3arch/agent/ntforg/trap-v1-from-specific-address.py index 090e599..2bfa05d 100644 --- a/examples/v3arch/agent/ntforg/trap-v1-from-specific-address.py +++ b/examples/v3arch/agent/ntforg/trap-v1-from-specific-address.py @@ -54,19 +54,25 @@ config.addVacmUser(snmpEngine, 1, '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), + # instance Index + None ) print('Notification is scheduled to be sent') |