diff options
author | elie <elie> | 2015-09-27 10:26:25 +0000 |
---|---|---|
committer | elie <elie> | 2015-09-27 10:26:25 +0000 |
commit | 627d9ff4a3715477e56fe397f099ad0db0d5c1b9 (patch) | |
tree | 60cdd6f446e892194122abad0dfa4c6413eb4374 /examples/hlapi/asyncore/manager | |
parent | bdfbce73382678e0288d8bc8d3093c827b05e1d1 (diff) | |
download | pysnmp-627d9ff4a3715477e56fe397f099ad0db0d5c1b9.tar.gz |
* Asyncore and asyncio-based APIs reworked to become functions.
* Asyncio and Twisted API moved entirely into high-level domain to
be aligned with other high-level APIs. This WILL BREAK backward
compatibility for those apps that use Twisted API.
Diffstat (limited to 'examples/hlapi/asyncore/manager')
33 files changed, 41 insertions, 65 deletions
diff --git a/examples/hlapi/asyncore/manager/cmdgen/async-pull-mibs-from-multiple-agents-at-once.py b/examples/hlapi/asyncore/manager/cmdgen/async-pull-mibs-from-multiple-agents-at-once.py index ecb35ee..b671f19 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/async-pull-mibs-from-multiple-agents-at-once.py +++ b/examples/hlapi/asyncore/manager/cmdgen/async-pull-mibs-from-multiple-agents-at-once.py @@ -12,7 +12,7 @@ following options: over IPv6/UDP * to an Agent at demo.snmplabs.com:161 and to an Agent at [::1]:161 -* for multiple MIB subtrees and tables +* pull variables till EOM """# from pysnmp.hlapi.asyncore import * @@ -44,7 +44,7 @@ targets = ( # Wait for responses or errors, submit GETNEXT requests for further OIDs def cbFun(snmpEngine, sendRequestHandle, errorIndication, errorStatus, errorIndex, varBindTable, cbCtx): - (varBindHead, authData, transportTarget) = cbCtx + (authData, transportTarget) = cbCtx print('%s via %s' % (authData, transportTarget)) if errorIndication: print(errorIndication) @@ -57,13 +57,6 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, ) return else: - for idx, varBind in enumerate(varBindTable[-1]): - if varBind[1] is not None and varBindHead[idx] <= varBind[0]: - break # still in table - else: - print('went out of table at %s' % (name, )) - return - for varBindRow in varBindTable: for varBind in varBindRow: print(' = '.join([ x.prettyPrint() for x in varBind ])) @@ -72,15 +65,9 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, snmpEngine = SnmpEngine() -cmdGen = AsyncCommandGenerator() - # Submit initial GETNEXT requests and wait for responses for authData, transportTarget, varBinds in targets: - varBindHead = [ x[0] for x in cmdGen.makeVarBinds(snmpEngine, varBinds ) ] - cmdGen.nextCmd( - snmpEngine, authData, transportTarget, ContextData(), varBinds, - # User-space callback function and its context - (cbFun, (varBindHead, authData, transportTarget)) - ) + nextCmd(snmpEngine, authData, transportTarget, ContextData(), varBinds, + cbFun=cbFun, cbCtx=(authData, transportTarget)) snmpEngine.transportDispatcher.runDispatcher() diff --git a/examples/hlapi/asyncore/manager/cmdgen/async-query-multiple-snmp-engines.py b/examples/hlapi/asyncore/manager/cmdgen/async-query-multiple-snmp-engines.py index 1ce32ae..d0a5c62 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/async-query-multiple-snmp-engines.py +++ b/examples/hlapi/asyncore/manager/cmdgen/async-query-multiple-snmp-engines.py @@ -88,14 +88,10 @@ snmpEngineA.registerTransportDispatcher(transportDispatcher, 'A') snmpEngineB = SnmpEngine() snmpEngineB.registerTransportDispatcher(transportDispatcher, 'B') -cmdGen = AsyncCommandGenerator() - for authData, transportTarget, varBinds in targets: snmpEngine = transportTarget.getTransportInfo()[1][1] % 3 and \ snmpEngineA or snmpEngineB - cmdGen.getCmd( - snmpEngine, authData, transportTarget, ContextData(), varBinds, - (cbFun, (snmpEngine, authData, transportTarget)) - ) + getCmd(snmpEngine, authData, transportTarget, ContextData(), varBinds, + cbFun=cbFun, cbCtx=(snmpEngine, authData, transportTarget)) transportDispatcher.runDispatcher() diff --git a/examples/hlapi/asyncore/manager/cmdgen/coerce-set-value-to-mib-spec.py b/examples/hlapi/asyncore/manager/cmdgen/coerce-set-value-to-mib-spec.py index bbcac86..ab2df92 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/coerce-set-value-to-mib-spec.py +++ b/examples/hlapi/asyncore/manager/cmdgen/coerce-set-value-to-mib-spec.py @@ -15,7 +15,7 @@ Functionally similar to: | = "new system name" """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( setCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/custom-asn1-mib-search-path.py b/examples/hlapi/asyncore/manager/cmdgen/custom-asn1-mib-search-path.py index 445d665..22fbe6d 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/custom-asn1-mib-search-path.py +++ b/examples/hlapi/asyncore/manager/cmdgen/custom-asn1-mib-search-path.py @@ -16,7 +16,7 @@ Functionally similar to: | IF-MIB::ifInOctets.1 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py b/examples/hlapi/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py index 2e84bba..1244583 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py +++ b/examples/hlapi/asyncore/manager/cmdgen/custom-contextengineid-and-contextname.py @@ -20,7 +20,7 @@ Functionally similar to: | SNMPv2-MIB::sysORDescr.1 = "new system name" """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( setCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/custom-contextengineid.py b/examples/hlapi/asyncore/manager/cmdgen/custom-contextengineid.py index d8e19ab..ea97c59 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/custom-contextengineid.py +++ b/examples/hlapi/asyncore/manager/cmdgen/custom-contextengineid.py @@ -18,7 +18,7 @@ Functionally similar to: | SNMPv2-MIB::sysORDescr.1 = "new system name" """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( setCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/custom-pysnmp-mibs-search-path.py b/examples/hlapi/asyncore/manager/cmdgen/custom-pysnmp-mibs-search-path.py index e49ef4b..42b1df6 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/custom-pysnmp-mibs-search-path.py +++ b/examples/hlapi/asyncore/manager/cmdgen/custom-pysnmp-mibs-search-path.py @@ -18,7 +18,7 @@ Functionally similar to: | demo.snmplabs.com TCP-MIB::tcpConnTable """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/custom-timeout-and-retries.py b/examples/hlapi/asyncore/manager/cmdgen/custom-timeout-and-retries.py index a6965fe..cfa274f 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/custom-timeout-and-retries.py +++ b/examples/hlapi/asyncore/manager/cmdgen/custom-timeout-and-retries.py @@ -25,16 +25,16 @@ means one initial request plus one retry. Functionally similar to: -| $ snmpget -v1 -c public demo.snmplabs.com 1.3.6.1.2.1.1.1.0 +| $ snmpget -v1 -c public -t 2 -r 0 demo.snmplabs.com 1.3.6.1.2.1.1.1.0 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), CommunityData('public'), UdpTransportTarget( - ('demo.snmplabs.com', 161), timeout=1.5, retries=0 + ('demo.snmplabs.com', 161), timeout=2.0, retries=0 ), ContextData(), ObjectType(ObjectIdentity('1.3.6.1.2.1.1.1.0'))) diff --git a/examples/hlapi/asyncore/manager/cmdgen/custom-v3-security-name.py b/examples/hlapi/asyncore/manager/cmdgen/custom-v3-security-name.py index 77c4cf6..4346b26 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/custom-v3-security-name.py +++ b/examples/hlapi/asyncore/manager/cmdgen/custom-v3-security-name.py @@ -15,7 +15,7 @@ allows you to address a USM Table row just as userName does. However securityName can be made human-readable, also it is not an index in usmUserTable, thus duplicate securityName parameters are possible. """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py b/examples/hlapi/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py index 3967ab6..d431659 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py +++ b/examples/hlapi/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py @@ -17,7 +17,7 @@ Functionally similar to: | 1.3.6.1.2.1.1.2.0 \ | 1.3.6.1.2.1.1.3.0 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/get-table-object-by-index.py b/examples/hlapi/asyncore/manager/cmdgen/get-table-object-by-index.py index 6b382ea..fc8a882 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/get-table-object-by-index.py +++ b/examples/hlapi/asyncore/manager/cmdgen/get-table-object-by-index.py @@ -17,7 +17,7 @@ Functionally similar to: | IF-MIB::ifInOctets.1 IF-MIB::ifOutOctets.1 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/get-table-object-by-multiple-indices.py b/examples/hlapi/asyncore/manager/cmdgen/get-table-object-by-multiple-indices.py index e344dc0..5d0621d 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/get-table-object-by-multiple-indices.py +++ b/examples/hlapi/asyncore/manager/cmdgen/get-table-object-by-multiple-indices.py @@ -17,7 +17,7 @@ Functionally similar to: | TCP-MIB::tcpConnLocalAddress."0.0.0.0".22."0.0.0.0".0 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py b/examples/hlapi/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py index f30ae1e..6b18d42 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py +++ b/examples/hlapi/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py @@ -20,7 +20,7 @@ Functionally similar to: | IP-MIB::ipAddrEntry """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/getbulk-limit-number-of-packets.py b/examples/hlapi/asyncore/manager/cmdgen/getbulk-limit-number-of-packets.py index 0cf9e0f..5146808 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/getbulk-limit-number-of-packets.py +++ b/examples/hlapi/asyncore/manager/cmdgen/getbulk-limit-number-of-packets.py @@ -17,7 +17,7 @@ Functionally similar to: | demo.snmplabs.com SNMPv2-MIB::system """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/getbulk-limit-number-of-variables.py b/examples/hlapi/asyncore/manager/cmdgen/getbulk-limit-number-of-variables.py index ec2abdd..ef95f5a 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/getbulk-limit-number-of-variables.py +++ b/examples/hlapi/asyncore/manager/cmdgen/getbulk-limit-number-of-variables.py @@ -19,7 +19,7 @@ Functionally similar to: | 1.3.6.1.2.1.2.2 1.3.6.1.2.1.2.3 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/getnext-limit-number-of-variables.py b/examples/hlapi/asyncore/manager/cmdgen/getnext-limit-number-of-variables.py index 2844bfa..9536ebb 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/getnext-limit-number-of-variables.py +++ b/examples/hlapi/asyncore/manager/cmdgen/getnext-limit-number-of-variables.py @@ -18,7 +18,7 @@ Functionally similar to: | SNMPv2-MIB::system """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/getnext-multiple-oids-to-eom.py b/examples/hlapi/asyncore/manager/cmdgen/getnext-multiple-oids-to-eom.py index ac66388..c2858a7 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/getnext-multiple-oids-to-eom.py +++ b/examples/hlapi/asyncore/manager/cmdgen/getnext-multiple-oids-to-eom.py @@ -16,7 +16,7 @@ Functionally similar to: | 1.3.6.1.2.1.2.2.1.2 1.3.6.1.2.1.2.2.1.3 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-async-queries.py b/examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-async-queries.py index 0c6e9bf..6222c3e 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-async-queries.py +++ b/examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-async-queries.py @@ -72,14 +72,9 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, snmpEngine = SnmpEngine() -cmdGen = AsyncCommandGenerator() - # Submit GET requests for authData, transportTarget, varNames in targets: - cmdGen.getCmd( - snmpEngine, authData, transportTarget, ContextData(), varNames, - # User-space callback function and its context - (cbFun, (authData, transportTarget)) - ) + getCmd(snmpEngine, authData, transportTarget, ContextData(), varNames, + cbFun=cbFun, cbCtx=(authData, transportTarget)) snmpEngine.transportDispatcher.runDispatcher() diff --git a/examples/hlapi/asyncore/manager/cmdgen/multiple-get-calls.py b/examples/hlapi/asyncore/manager/cmdgen/multiple-get-calls.py index b17da65..d8c63ef 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/multiple-get-calls.py +++ b/examples/hlapi/asyncore/manager/cmdgen/multiple-get-calls.py @@ -20,7 +20,7 @@ Functionally similar to: | IF-MIB::ifInOctets.1 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * queue = [ [ ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1)) ], [ ObjectType(ObjectIdentity('IF-MIB', 'ifOutOctets', 1)) ] ] diff --git a/examples/hlapi/asyncore/manager/cmdgen/preload-pysnmp-mibs.py b/examples/hlapi/asyncore/manager/cmdgen/preload-pysnmp-mibs.py index 080b5d1..885dbdf 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/preload-pysnmp-mibs.py +++ b/examples/hlapi/asyncore/manager/cmdgen/preload-pysnmp-mibs.py @@ -18,7 +18,7 @@ Functionally similar to: | 1.3.6 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py b/examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py index 479c504..10538f2 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py +++ b/examples/hlapi/asyncore/manager/cmdgen/pull-whole-mib.py @@ -8,7 +8,6 @@ Send a series of SNMP GETNEXT requests using the following options: * over IPv4/UDP * to an Agent at demo.snmplabs.com:161 * for all OIDs in IF-MIB -* stop when response OIDs leave the scopes of the table Functionally similar to: @@ -16,7 +15,7 @@ Functionally similar to: | demo.snmplabs.com IF-MIB:: """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ @@ -24,8 +23,7 @@ for errorIndication, \ UsmUserData('usr-md5-none', 'authkey1'), UdpTransportTarget(('demo.snmplabs.com', 161)), ContextData(), - ObjectType(ObjectIdentity('IF-MIB')), - lexicographicMode=False): + ObjectType(ObjectIdentity('IF-MIB'))): if errorIndication: print(errorIndication) diff --git a/examples/hlapi/asyncore/manager/cmdgen/pull-whole-snmp-table.py b/examples/hlapi/asyncore/manager/cmdgen/pull-whole-snmp-table.py index 3c3f40b..5b8d221 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/pull-whole-snmp-table.py +++ b/examples/hlapi/asyncore/manager/cmdgen/pull-whole-snmp-table.py @@ -21,7 +21,7 @@ Functionally similar to: | IF-MIB::ifType \ """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/query-agents-from-multuple-threads.py b/examples/hlapi/asyncore/manager/cmdgen/query-agents-from-multuple-threads.py index 442855a..34ead8b 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/query-agents-from-multuple-threads.py +++ b/examples/hlapi/asyncore/manager/cmdgen/query-agents-from-multuple-threads.py @@ -22,7 +22,7 @@ if version_info[0] == 2: else: from queue import Queue from threading import Thread -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * # List of targets in the followin format: # ( ( authData, transportTarget, varNames ), ... ) diff --git a/examples/hlapi/asyncore/manager/cmdgen/set-multiple-scalar-values.py b/examples/hlapi/asyncore/manager/cmdgen/set-multiple-scalar-values.py index b2b67eb..c3d3c5c 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/set-multiple-scalar-values.py +++ b/examples/hlapi/asyncore/manager/cmdgen/set-multiple-scalar-values.py @@ -21,7 +21,7 @@ Functionally similar to: | 1.3.6.1.2.1.1.9.1.3.1 s "new system name" """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( setCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/specific-v3-engine-id.py b/examples/hlapi/asyncore/manager/cmdgen/specific-v3-engine-id.py index f7db38f..72263be 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/specific-v3-engine-id.py +++ b/examples/hlapi/asyncore/manager/cmdgen/specific-v3-engine-id.py @@ -18,7 +18,7 @@ Send SNMP GET request using the following scenario and options: * for an OID in text form """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * snmpEngine = SnmpEngine() diff --git a/examples/hlapi/asyncore/manager/cmdgen/usm-md5-des.py b/examples/hlapi/asyncore/manager/cmdgen/usm-md5-des.py index cdd6ce3..1d8030d 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/usm-md5-des.py +++ b/examples/hlapi/asyncore/manager/cmdgen/usm-md5-des.py @@ -16,7 +16,7 @@ Functionally similar to: | IF-MIB::ifInOctets.1 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/usm-md5-none.py b/examples/hlapi/asyncore/manager/cmdgen/usm-md5-none.py index 363bddb..c38d2f3 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/usm-md5-none.py +++ b/examples/hlapi/asyncore/manager/cmdgen/usm-md5-none.py @@ -15,7 +15,7 @@ Functionally similar to: | IF-MIB::ifInOctets.1 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/usm-none-none.py b/examples/hlapi/asyncore/manager/cmdgen/usm-none-none.py index 5049a7c..15f570a 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/usm-none-none.py +++ b/examples/hlapi/asyncore/manager/cmdgen/usm-none-none.py @@ -16,7 +16,7 @@ Functionally similar to: | IF-MIB::ifInOctets.1 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/usm-sha-aes128.py b/examples/hlapi/asyncore/manager/cmdgen/usm-sha-aes128.py index 1a1c0cb..1e985f5 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/usm-sha-aes128.py +++ b/examples/hlapi/asyncore/manager/cmdgen/usm-sha-aes128.py @@ -32,7 +32,7 @@ Functionally similar to: | SNMPv2-MIB::sysDescr.0 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/v1-get.py b/examples/hlapi/asyncore/manager/cmdgen/v1-get.py index 7d417ef..3f03c7c 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/v1-get.py +++ b/examples/hlapi/asyncore/manager/cmdgen/v1-get.py @@ -14,7 +14,7 @@ Functionally similar to: | $ snmpget -v1 -c public demo.snmplabs.com SNMPv2-MIB::sysDescr.0 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/v2c-get.py b/examples/hlapi/asyncore/manager/cmdgen/v2c-get.py index a11c48c..169b6a6 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/v2c-get.py +++ b/examples/hlapi/asyncore/manager/cmdgen/v2c-get.py @@ -15,7 +15,7 @@ Functionally similar to: | 1.3.6.1.2.1.1.6.0 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * errorIndication, errorStatus, errorIndex, varBinds = next( getCmd(SnmpEngine(), diff --git a/examples/hlapi/asyncore/manager/cmdgen/v2c-getbulk.py b/examples/hlapi/asyncore/manager/cmdgen/v2c-getbulk.py index ff82017..a65bb35 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/v2c-getbulk.py +++ b/examples/hlapi/asyncore/manager/cmdgen/v2c-getbulk.py @@ -18,7 +18,7 @@ Functionally similar to: | 1.3.6.1.2.1.2.2 1.3.6.1.2.1.2.3 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ diff --git a/examples/hlapi/asyncore/manager/cmdgen/waive-mib-lookup.py b/examples/hlapi/asyncore/manager/cmdgen/waive-mib-lookup.py index 595d7ad..7038d96 100644 --- a/examples/hlapi/asyncore/manager/cmdgen/waive-mib-lookup.py +++ b/examples/hlapi/asyncore/manager/cmdgen/waive-mib-lookup.py @@ -19,7 +19,7 @@ Functionally similar to: | $ snmpwalk -v2c -c public -ObentU demo.snmplabs.com 1.3.6.1.2.1 """# -from pysnmp.hlapi.asyncore import * +from pysnmp.hlapi import * for errorIndication, \ errorStatus, errorIndex, \ |