From 2f04f1834d21da2fcb58e158ea237acf79b7eb17 Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Mon, 25 Feb 2019 11:33:47 +0100 Subject: Fix failing example scripts --- .../asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py | 5 +++-- .../sync/manager/cmdgen/get-table-object-by-multiple-indices.py | 2 +- examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py | 2 +- .../asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py | 5 +++-- .../sync/manager/cmdgen/get-table-object-by-multiple-indices.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py index 7f1f8d2c..6b5f880c 100644 --- a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py +++ b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py @@ -10,7 +10,8 @@ Send a series of SNMP GETBULK requests using the following options: * for all OIDs within TCP-MIB::tcpConnTable column * TCP-MIB Python module will be searched by a user-specified filesystem path (/opt/mib/pysnmp) and in Python package (python_packaged_mibs) - which should be in sys.path + which should be in sys.path. If not found, TCP-MIB will be downloaded + from the web, compiled into Python and cached for further use. * with MIB lookup enabled Functionally similar to: @@ -29,7 +30,7 @@ iterator = bulkCmd( ObjectIdentity('TCP-MIB', 'tcpConnTable').addMibSource( '/opt/mibs/pysnmp').addMibSource( 'python_packaged_mibs') - ), + ).addAsn1MibSource('http://mibs.snmplabs.com/asn1/@mib@'), lookupMib=True, lexicographicMode=False ) diff --git a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py index ae888ae3..0163ad08 100644 --- a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py +++ b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py @@ -28,7 +28,7 @@ iterator = getCmd( '0.0.0.0', 22, '0.0.0.0', 0 ) - ), + ).addAsn1MibSource('http://mibs.snmplabs.com/asn1/@mib@'), lookupMib=True ) diff --git a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py index 71cf6a70..f900018f 100644 --- a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py +++ b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/pull-whole-mib.py @@ -24,7 +24,7 @@ iterator = nextCmd( ObjectType(ObjectIdentity('IF-MIB')) ) -for errorIndication, errorStatus, errorIndex, varBinds in interator: +for errorIndication, errorStatus, errorIndex, varBinds in iterator: if errorIndication: print(errorIndication) diff --git a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py index 33d72f1f..00a2c9e7 100644 --- a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py +++ b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py @@ -10,7 +10,8 @@ Send a series of SNMP GETBULK requests using the following options: * for all OIDs within TCP-MIB::tcpConnTable column * TCP-MIB Python module will be searched by a user-specified filesystem path (/opt/mib/pysnmp) and in Python package (python_packaged_mibs) - which should be in sys.path + which should be in sys.path. If not found, TCP-MIB will be downloaded + from the web, compiled into Python and cached for further use. Functionally similar to: @@ -33,7 +34,7 @@ iterator = bulkCmd( ).addMibSource( 'python_packaged_mibs' ) - ), + ).addAsn1MibSource('http://mibs.snmplabs.com/asn1/@mib@'), lexicographicMode=False ) diff --git a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py index 733bd9cb..c04b6891 100644 --- a/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py +++ b/examples/hlapi/v3arch/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py @@ -32,7 +32,7 @@ iterator = getCmd( '0.0.0.0', 22, '0.0.0.0', 0 ) - ) + ).addAsn1MibSource('http://mibs.snmplabs.com/asn1/@mib@') ) errorIndication, errorStatus, errorIndex, varBinds = next(iterator) -- cgit v1.2.1