From 0f190c6a3817c5d0c4e38430a4e4714aa30063f1 Mon Sep 17 00:00:00 2001 From: elie Date: Mon, 30 Sep 2013 21:10:52 +0000 Subject: examples adjusted to work with fixed-EngineID SNMP simulator --- .../sync/manager/cmdgen/custom-contextengineid-and-contextname.py | 8 ++++---- .../hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'examples/hlapi/asyncore/sync/manager') 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 2aa6407f..e273bba6 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 @@ -7,8 +7,8 @@ # * over IPv4/UDP # * 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' +# * contextEngineId 0x80004fb805636c6f75644dab22cc and +# * contextName 'a172334d7d97871b72241397f713fa12' # * setting SNMPv2-MIB::sysName.0 to new value (type taken from MIB) # from pysnmp.entity.rfc3413.oneliner import cmdgen @@ -20,8 +20,8 @@ errorIndication, errorStatus, errorIndex, varBinds = cmdGen.setCmd( cmdgen.UsmUserData('usr-md5-none', 'authkey1'), cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)), (cmdgen.MibVariable('SNMPv2-MIB', 'sysORDescr', 1), 'new system name'), - contextEngineId=rfc1902.OctetString(hexValue='8000000001020304'), - contextName='my-context' + contextEngineId=rfc1902.OctetString(hexValue='80004fb805636c6f75644dab22cc'), + contextName='da761cfc8c94d3aceef4f60f049105ba' ) # Check for errors and print out results diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py index 8a5242fd..04ee0bf5 100644 --- a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py +++ b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-contextengineid.py @@ -4,7 +4,8 @@ # Send SNMP GET request using the following options: # # * with SNMPv3 with user 'usr-md5-des', MD5 auth and DES privacy protocols -# * use remote SNMP Engine ID 0x8000000004030201 (USM autodiscovery will run) +# * use remote SNMP Engine ID 0x80004fb805636c6f75644dab22cc (USM +# autodiscovery will run) # * over IPv4/UDP # * to an Agent at demo.snmplabs.com:161 # * setting SNMPv2-MIB::sysName.0 to new value (type taken from MIB) @@ -17,7 +18,9 @@ cmdGen = cmdgen.CommandGenerator() errorIndication, errorStatus, errorIndex, varBinds = cmdGen.setCmd( cmdgen.UsmUserData( 'usr-md5-des', 'authkey1', 'privkey1', - securityEngineId=rfc1902.OctetString(hexValue='8000000004030201') + securityEngineId=rfc1902.OctetString( + hexValue='80004fb805636c6f75644dab22cc' + ) ), cmdgen.UdpTransportTarget(('demo.snmplabs.com', 161)), (cmdgen.MibVariable('SNMPv2-MIB', 'sysORDescr', 1), 'new system name'), -- cgit v1.2.1