summaryrefslogtreecommitdiff
path: root/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py')
-rw-r--r--examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py b/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py
index 552ad877..4846f9da 100644
--- a/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py
+++ b/examples/hlapi/v3arch/asyncore/sync/agent/ntforg/default-v1-trap.py
@@ -22,23 +22,23 @@ Functionally similar to:
"""#
from pysnmp.hlapi import *
-errorIndication, errorStatus, errorIndex, varBinds = next(
- sendNotification(
- SnmpEngine(),
- CommunityData('public', mpModel=0),
- UdpTransportTarget(('demo.snmplabs.com', 162)),
- ContextData(),
- 'trap',
- NotificationType(
- ObjectIdentity('1.3.6.1.6.3.1.1.5.2')
- ).addVarBinds(
- ('1.3.6.1.6.3.1.1.4.3.0', '1.3.6.1.4.1.20408.4.1.1.2'),
- ('1.3.6.1.2.1.1.1.0', OctetString('my system'))
- ).loadMibs(
- 'SNMPv2-MIB'
- )
+iterator = sendNotification(
+ SnmpEngine(),
+ CommunityData('public', mpModel=0),
+ UdpTransportTarget(('demo.snmplabs.com', 162)),
+ ContextData(),
+ 'trap',
+ NotificationType(
+ ObjectIdentity('1.3.6.1.6.3.1.1.5.2')
+ ).addVarBinds(
+ ('1.3.6.1.6.3.1.1.4.3.0', '1.3.6.1.4.1.20408.4.1.1.2'),
+ ('1.3.6.1.2.1.1.1.0', OctetString('my system'))
+ ).loadMibs(
+ 'SNMPv2-MIB'
)
)
+errorIndication, errorStatus, errorIndex, varBinds = next(iterator)
+
if errorIndication:
print(errorIndication)