summaryrefslogtreecommitdiff
path: root/examples/hlapi
diff options
context:
space:
mode:
authorelie <elie>2013-05-05 12:43:52 +0000
committerelie <elie>2013-05-05 12:43:52 +0000
commitc32db16bfd2806d621a9f2bad0228764af9e72de (patch)
treeead0cd8563400565679075eb92298435303506b1 /examples/hlapi
parentf3213f28d605a41c81d5861d2df0143758c82ca1 (diff)
downloadpysnmp-git-c32db16bfd2806d621a9f2bad0228764af9e72de.tar.gz
most of Command Generator examples re-pointed to a live SNMP Agent
at demo.snmplabs.com to ease experimentation and adoption
Diffstat (limited to 'examples/hlapi')
-rw-r--r--examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-queries.py18
-rw-r--r--examples/hlapi/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py8
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py6
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid-and-contextname.py6
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py6
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py4
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-index.py8
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py4
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py4
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/getnext-multiple-oids-to-eom.py4
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py4
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-snmp-table.py4
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py10
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py8
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py4
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/v2c-get.py4
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/v2c-getbulk.py4
17 files changed, 56 insertions, 50 deletions
diff --git a/examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-queries.py b/examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-queries.py
index 85dad1b2..7f68d024 100644
--- a/examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-queries.py
+++ b/examples/hlapi/asyncore/manager/cmdgen/multiple-concurrent-queries.py
@@ -8,7 +8,7 @@
# with SNMPv3, user 'usr-md5-des', MD5 auth and DES privacy
# * over IPv4/UDP and
# over IPv6/UDP
-# * to an Agent at localhost:161 and
+# * to an Agent at demo.snmplabs.com:161 and
# to an Agent at [::1]:161
# * for instances of SNMPv2-MIB::sysDescr.0 and
# SNMPv2-MIB::sysLocation.0 MIB objects
@@ -20,20 +20,26 @@ from pysnmp.entity.rfc3413.oneliner import cmdgen
targets = (
# 1-st target (SNMPv1 over IPv4/UDP)
( cmdgen.CommunityData('public', mpModel=0),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
( cmdgen.MibVariable('SNMPv2-MIB', 'sysDescr', 0),
cmdgen.MibVariable('SNMPv2-MIB', 'sysLocation', 0) ) ),
# 2-nd target (SNMPv2c over IPv4/UDP)
( cmdgen.CommunityData('public'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
( cmdgen.MibVariable('SNMPv2-MIB', 'sysDescr', 0),
cmdgen.MibVariable('SNMPv2-MIB', 'sysLocation', 0) ) ),
- # 3-nd target (SNMPv3 over IPv4/UDP)
- ( cmdgen.UsmUserData('usr-md5-des', 'authkey1', 'privkey1'),
+ # 3-nd target (SNMPv2c over IPv4/UDP) - same community and
+ # different transport address.
+ ( cmdgen.CommunityData('public'),
cmdgen.UdpTransportTarget(('localhost', 161)),
+ ( cmdgen.MibVariable('SNMPv2-MIB', 'sysContact', 0),
+ cmdgen.MibVariable('SNMPv2-MIB', 'sysName', 0) ) ),
+ # 4-nd target (SNMPv3 over IPv4/UDP)
+ ( cmdgen.UsmUserData('usr-md5-des', 'authkey1', 'privkey1'),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
( cmdgen.MibVariable('SNMPv2-MIB', 'sysDescr', 0),
cmdgen.MibVariable('SNMPv2-MIB', 'sysLocation', 0) ) ),
- # 4-th target (SNMPv3 over IPv6/UDP)
+ # 5-th target (SNMPv3 over IPv6/UDP)
( cmdgen.UsmUserData('usr-md5-none', 'authkey1'),
cmdgen.Udp6TransportTarget(('::1', 161)),
( cmdgen.MibVariable('SNMPv2-MIB', 'sysDescr', 0),
diff --git a/examples/hlapi/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py b/examples/hlapi/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py
index 761bdaa5..76b860fd 100644
--- a/examples/hlapi/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py
+++ b/examples/hlapi/asyncore/manager/cmdgen/pull-mibs-from-multiple-agents-at-once.py
@@ -8,7 +8,7 @@
# with SNMPv3, user 'usr-md5-des', MD5 auth and DES privacy
# * over IPv4/UDP and
# over IPv6/UDP
-# * to an Agent at localhost:161 and
+# * to an Agent at demo.snmplabs.com:161 and
# to an Agent at [::1]:161
# * for multiple MIB subtrees and tables
#
@@ -19,15 +19,15 @@ from pysnmp.entity.rfc3413.oneliner import cmdgen
targets = (
# 1-st target (SNMPv1 over IPv4/UDP)
( cmdgen.CommunityData('public', mpModel=0),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
( '1.3.6.1.2.1', '1.3.6.1.3.1') ),
# 2-nd target (SNMPv2c over IPv4/UDP)
( cmdgen.CommunityData('public'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
( '1.3.6.1.4.1', ) ),
# 3-nd target (SNMPv3 over IPv4/UDP)
( cmdgen.UsmUserData('usr-md5-des', 'authkey1', 'privkey1'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
( cmdgen.MibVariable('SNMPv2-MIB', 'system'), ) ),
# 4-th target (SNMPv3 over IPv6/UDP)
( cmdgen.UsmUserData('usr-md5-none', 'authkey1'),
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py b/examples/hlapi/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
index 13aa413b..d58ad9ca 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/coerce-set-value-to-mib-spec.py
@@ -5,7 +5,7 @@
#
# * with SNMPv2c, community 'public'
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * setting SNMPv2-MIB::sysName.0 to new value (type taken from MIB)
#
from pysnmp.entity.rfc3413.oneliner import cmdgen
@@ -14,8 +14,8 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.setCmd(
cmdgen.CommunityData('public'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
- (cmdgen.MibVariable('SNMPv2-MIB', 'sysName', 0), 'new system name')
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
+ (cmdgen.MibVariable('SNMPv2-MIB', 'sysORDescr', 1), 'new system name')
)
# Check for errors and print out results
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid-and-contextname.py b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid-and-contextname.py
index 12aea8a3..2aa6407f 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid-and-contextname.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid-and-contextname.py
@@ -5,7 +5,7 @@
#
# * with SNMPv3 with user 'usr-md5-none', MD5 auth and no privacy protocols
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * addressing particular set of Managed Objects at remote SNMP Engine by:
# * contextEngineId 0x8000000001020304 and
# * contextName 'my-context'
@@ -18,8 +18,8 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.setCmd(
cmdgen.UsmUserData('usr-md5-none', 'authkey1'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
- (cmdgen.MibVariable('SNMPv2-MIB', 'sysName', 0), 'new system name'),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
+ (cmdgen.MibVariable('SNMPv2-MIB', 'sysORDescr', 1), 'new system name'),
contextEngineId=rfc1902.OctetString(hexValue='8000000001020304'),
contextName='my-context'
)
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py
index 20a0c094..f0c949e2 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py
@@ -6,7 +6,7 @@
# * with SNMPv3 with user 'usr-md5-des', MD5 auth and DES privacy protocols
# * use remote SNMP Engine ID 0x8000000004030201 (USM autodiscovery will run)
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * setting SNMPv2-MIB::sysName.0 to new value (type taken from MIB)
#
from pysnmp.entity.rfc3413.oneliner import cmdgen
@@ -19,8 +19,8 @@ errorIndication, errorStatus, errorIndex, varBinds = cmdGen.setCmd(
'usr-md5-des', 'authkey1', 'privkey1',
contextEngineId=rfc1902.OctetString(hexValue='8000000004030201')
),
- cmdgen.UdpTransportTarget(('localhost', 161)),
- (cmdgen.MibVariable('SNMPv2-MIB', 'sysName', 0), 'new system name'),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
+ (cmdgen.MibVariable('SNMPv2-MIB', 'sysORDescr', 1), 'new system name'),
)
# Check for errors and print out results
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
index 3672f5db..f85cf6b2 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-pysnmp-mibs-search-path.py
@@ -5,7 +5,7 @@
#
# * with SNMPv3, user 'usr-none-none', no authentication, no privacy
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * for all OIDs past TCP-MIB::tcpConnTable
# * TCP-MIB will be searched by a user-specified path
# * run till end-of-mib condition is reported by Agent OR maxRows == 20
@@ -19,7 +19,7 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.bulkCmd(
cmdgen.UsmUserData('usr-none-none'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
0, 50,
cmdgen.MibVariable('TCP-MIB', 'tcpConnTable').addMibSource('/tmp/mymibs'),
lexicographicMode=True, maxRows=100, ignoreNonIncreasingOid=True
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-index.py b/examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
index 065509d3..35fe0df4 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-index.py
@@ -5,8 +5,8 @@
#
# * with SNMPv3, user 'usr-none-none', no authentication, no privacy
# * over IPv4/UDP
-# * to an Agent at localhost:161
-# * for IP-MIB::ipAdEntAddr.127.0.0.1 MIB object
+# * to an Agent at demo.snmplabs.com:161
+# * for IF-MIB::ifInOctets.1 MIB object
# * perform response OIDs and values resolution at MIB
#
from pysnmp.entity.rfc3413.oneliner import cmdgen
@@ -15,8 +15,8 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(
cmdgen.UsmUserData('usr-none-none'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
- cmdgen.MibVariable('IP-MIB', 'ipAdEntAddr', '127.0.0.1'),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
+ cmdgen.MibVariable('IF-MIB', 'ifInOctets', '1'),
lookupNames=True, lookupValues=True
)
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py b/examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py
index df7dafcd..74f31b0e 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/get-table-object-by-multiple-indices.py
@@ -5,7 +5,7 @@
#
# * with SNMPv3, user 'usr-sha-aes128', SHA auth, AES128 privacy
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * for TCP-MIB::tcpConnLocalAddress."0.0.0.0".22."0.0.0.0".0 MIB object
#
from pysnmp.entity.rfc3413.oneliner import cmdgen
@@ -16,7 +16,7 @@ errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(
cmdgen.UsmUserData('usr-sha-aes128', 'authkey1', 'privkey1',
authProtocol=cmdgen.usmHMACSHAAuthProtocol,
privProtocol=cmdgen.usmAesCfb128Protocol ),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
cmdgen.MibVariable('TCP-MIB', 'tcpConnLocalAddress', '0.0.0.0', 22, '0.0.0.0', 0)
)
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py b/examples/hlapi/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py
index a9d4f19f..2e9c9f43 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/getnext-limit-number-of-variables.py
@@ -5,7 +5,7 @@
#
# * with SNMPv3, user 'usr-sha-aes128', SHA auth, AES128 privacy
# * over Local Domain Sockets
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * for all OIDs past IF-MIB (load up all MIBs in search path)
# * run till end-of-mib condition is reported by Agent OR maxRows == 100
# * ignoring non-increasing OIDs whenever reported by Agent
@@ -20,7 +20,7 @@ errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.nextCmd(
cmdgen.UsmUserData('usr-sha-aes128', 'authkey1', 'privkey1',
authProtocol=cmdgen.usmHMACSHAAuthProtocol,
privProtocol=cmdgen.usmAesCfb128Protocol),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
cmdgen.MibVariable('IF-MIB', '').loadMibs(),
lexicographicMode=True, maxRows=100,
ignoreNonIncreasingOid=True
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/getnext-multiple-oids-to-eom.py b/examples/hlapi/asyncore/sync/manager/cmdgen/getnext-multiple-oids-to-eom.py
index 40f0f144..74937a2a 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/getnext-multiple-oids-to-eom.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/getnext-multiple-oids-to-eom.py
@@ -5,7 +5,7 @@
#
# * with SNMPv2c, community 'public'
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * for two OIDs in string form
# * stop when response OIDs leave the scopes of initial OIDs
#
@@ -15,7 +15,7 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.nextCmd(
cmdgen.CommunityData('public'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
'1.3.6.1.2.1.2.2.1.2',
'1.3.6.1.2.1.2.2.1.3',
)
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py b/examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py
index e3e566b9..25352de8 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-mib.py
@@ -5,7 +5,7 @@
#
# * with SNMPv3, user 'usr-md5-none', MD5 authentication, no privacy
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * for all OIDs in IF-MIB
# * stop when response OIDs leave the scopes of the table
# * perform response values resolution at MIB
@@ -18,7 +18,7 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.nextCmd(
cmdgen.UsmUserData('usr-md5-none', 'authkey1'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
cmdgen.MibVariable('IF-MIB', ''),
lookupValues=True
)
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-snmp-table.py b/examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-snmp-table.py
index 9977164c..2a698959 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-snmp-table.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/pull-whole-snmp-table.py
@@ -5,7 +5,7 @@
#
# * with SNMPv1, community 'public'
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * for some columns of the IF-MIB::ifEntry table
# * stop when response OIDs leave the scopes of initial OIDs
#
@@ -17,7 +17,7 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.nextCmd(
cmdgen.CommunityData('public', mpModel=0),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
cmdgen.MibVariable('IF-MIB', 'ifDescr'),
cmdgen.MibVariable('IF-MIB', 'ifType'),
cmdgen.MibVariable('IF-MIB', 'ifMtu'),
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py b/examples/hlapi/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
index 1b3e1c38..b225b71f 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/set-multiple-scalar-values.py
@@ -5,7 +5,7 @@
#
# * with SNMPv1, community 'public'
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * setting two OIDs to new values (types explicitly specified)
#
from pysnmp.entity.rfc3413.oneliner import cmdgen
@@ -15,10 +15,10 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.setCmd(
cmdgen.CommunityData('public', mpModel=0),
- cmdgen.UdpTransportTarget(('localhost', 161)),
- ('1.3.6.1.2.1.1.2.0', rfc1902.ObjectName('1.3.6.1.4.1.20408.1.1')),
- ('1.3.6.1.2.1.1.2.0', '1.3.6.1.4.1.20408.1.1'),
- ('1.3.6.1.2.1.1.5.0', rfc1902.OctetString('new system name'))
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
+ ('1.3.6.1.2.1.1.9.1.2.1', rfc1902.ObjectName('1.3.6.1.4.1.20408.1.1')),
+ ('1.3.6.1.2.1.1.9.1.2.1', '1.3.6.1.4.1.20408.1.1'),
+ ('1.3.6.1.2.1.1.9.1.3.1', rfc1902.OctetString('new system name'))
)
# Check for errors and print out results
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py b/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
index 35a6d23c..5392c0c9 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
@@ -5,8 +5,8 @@
#
# * with SNMPv3, user 'usr-md5-none', MD5 authentication, no privacy
# * over IPv4/UDP
-# * to an Agent at localhost:161
-# * for IP-MIB::ipAdEntAddr.127.0.0.1 MIB object
+# * to an Agent at demo.snmplabs.com:161
+# * for IF-MIB::ifInOctets.1 MIB object
#
from pysnmp.entity.rfc3413.oneliner import cmdgen
@@ -14,8 +14,8 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(
cmdgen.UsmUserData('usr-md5-none', 'authkey1'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
- cmdgen.MibVariable('IP-MIB', 'ipAdEntAddr', '127.0.0.1')
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
+ cmdgen.MibVariable('IF-MIB', 'ifInOctets', '1')
)
# Check for errors and print out results
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py b/examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py
index 34ae8817..f05c5f80 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/v1-get.py
@@ -5,7 +5,7 @@
#
# * with SNMPv1, community 'public'
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * for two instances of SNMPv2-MIB::sysDescr.0 MIB object,
# * one in label and another in MIB symbol form
#
@@ -15,7 +15,7 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(
cmdgen.CommunityData('public', mpModel=0),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
cmdgen.MibVariable('iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0'),
cmdgen.MibVariable('SNMPv2-MIB', 'sysDescr', 0)
)
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/v2c-get.py b/examples/hlapi/asyncore/sync/manager/cmdgen/v2c-get.py
index fa2a263c..de39b6ce 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/v2c-get.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/v2c-get.py
@@ -5,7 +5,7 @@
#
# * with SNMPv2c, community 'public'
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * for two OIDs in string form
#
from pysnmp.entity.rfc3413.oneliner import cmdgen
@@ -14,7 +14,7 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(
cmdgen.CommunityData('public'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
'1.3.6.1.2.1.1.1.0',
'1.3.6.1.2.1.1.6.0'
)
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/v2c-getbulk.py b/examples/hlapi/asyncore/sync/manager/cmdgen/v2c-getbulk.py
index 6b8952ac..d6c974c2 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/v2c-getbulk.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/v2c-getbulk.py
@@ -5,7 +5,7 @@
#
# * with SNMPv2c, community 'public'
# * over IPv4/UDP
-# * to an Agent at localhost:161
+# * to an Agent at demo.snmplabs.com:161
# * with values non-repeaters = 0, max-repetitions = 25
# * for two OIDs in string form
# * stop when response OIDs leave the scopes of initial OIDs
@@ -16,7 +16,7 @@ cmdGen = cmdgen.CommandGenerator()
errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.bulkCmd(
cmdgen.CommunityData('public'),
- cmdgen.UdpTransportTarget(('localhost', 161)),
+ cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)),
0, 25,
'1.3.6.1.2.1.2.2.1.2',
'1.3.6.1.2.1.2.2.1.3',