summaryrefslogtreecommitdiff
path: root/examples/v3arch/agent/ntforg.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/v3arch/agent/ntforg.py')
-rw-r--r--examples/v3arch/agent/ntforg.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/v3arch/agent/ntforg.py b/examples/v3arch/agent/ntforg.py
index 97442fd..508e665 100644
--- a/examples/v3arch/agent/ntforg.py
+++ b/examples/v3arch/agent/ntforg.py
@@ -46,10 +46,19 @@ config.addTrapUser(snmpEngine, 3, 'test-user', 'authPriv', (1,3,6)) # v3
# SNMP context
snmpContext = context.SnmpContext(snmpEngine)
-
-ntforg.NotificationOriginator(snmpContext).sendNotification(
+
+def cbFun(snmpEngine, errorIndication):
+ if errorIndication:
+ print errorIndication
+
+errorIndication = ntforg.NotificationOriginator(snmpContext).sendNotification(
snmpEngine, 'myNotifyName', ('SNMPv2-MIB', 'coldStart'),
- (((1,3,6,1,2,1,1,5), v2c.OctetString('Example Notificator')),), ''
+ (((1,3,6,1,2,1,1,5), v2c.OctetString('Example Notificator')),),
+ cbFun
)
+if errorIndication:
+ print errorIndication
+ return
+
snmpEngine.transportDispatcher.runDispatcher()