summaryrefslogtreecommitdiff
path: root/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py')
-rw-r--r--examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
index b7fccdcb..38d248c2 100644
--- a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
+++ b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
@@ -17,15 +17,17 @@ Functionally similar to:
"""#
from pysnmp.hlapi.v1arch import *
-errorIndication, errorStatus, errorIndex, varBinds = next(
- getCmd(SnmpDispatcher(),
- CommunityData('public'),
- UdpTransportTarget(('demo.snmplabs.com', 161)),
- ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1)),
- ObjectType(ObjectIdentity('IF-MIB', 'ifOutOctets', 1)),
- lookupMib=True)
+iterator = getCmd(
+ SnmpDispatcher(),
+ CommunityData('public'),
+ UdpTransportTarget(('demo.snmplabs.com', 161)),
+ ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1)),
+ ObjectType(ObjectIdentity('IF-MIB', 'ifOutOctets', 1)),
+ lookupMib=True
)
+errorIndication, errorStatus, errorIndex, varBinds = next(iterator)
+
if errorIndication:
print(errorIndication)