diff options
author | Ilya Etingof <etingof@gmail.com> | 2019-02-25 11:33:47 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2019-02-25 11:33:47 +0100 |
commit | 2f04f1834d21da2fcb58e158ea237acf79b7eb17 (patch) | |
tree | e3fbeb8c3fd2c416df3afad12b387348217dd782 /examples | |
parent | 0780b2474eefbc3cfb1f2857657dfdd14e1def90 (diff) | |
download | pysnmp-git-2f04f1834d21da2fcb58e158ea237acf79b7eb17.tar.gz |
Fix failing example scripts
Diffstat (limited to 'examples')
5 files changed, 9 insertions, 7 deletions
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) |