diff options
author | elie <elie> | 2011-11-06 20:37:09 +0000 |
---|---|---|
committer | elie <elie> | 2011-11-06 20:37:09 +0000 |
commit | f0406dd01c46230ebbcd4f8c4a47fdbc270e64ef (patch) | |
tree | cae924c26bc40e6caafde18e657ab7fbb8794bbe /examples/smi/agent/operations-on-managed-objects.py | |
parent | 6781949a085961ff2eb6f4603a52249e99c4ce7d (diff) | |
download | pysnmp-git-f0406dd01c46230ebbcd4f8c4a47fdbc270e64ef.tar.gz |
major overhawl aimed at Python 2.4 through 3.2 compatibility
Diffstat (limited to 'examples/smi/agent/operations-on-managed-objects.py')
-rw-r--r-- | examples/smi/agent/operations-on-managed-objects.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/smi/agent/operations-on-managed-objects.py b/examples/smi/agent/operations-on-managed-objects.py index 3260a5e6..91a0eba9 100644 --- a/examples/smi/agent/operations-on-managed-objects.py +++ b/examples/smi/agent/operations-on-managed-objects.py @@ -1,31 +1,31 @@ # SNMP agent backend e.g. Agent access to Managed Objects from pysnmp.smi import builder, instrum, exval -print 'Loading MIB modules...', +print('Loading MIB modules...'), mibBuilder = builder.MibBuilder().loadModules( 'SNMPv2-MIB', 'SNMP-FRAMEWORK-MIB', 'SNMP-COMMUNITY-MIB' ) -print 'done' +print('done') -print 'Building MIB tree...', +print('Building MIB tree...'), mibInstrum = instrum.MibInstrumController(mibBuilder) -print 'done' +print('done') -print 'Remote manager write/create access to MIB instrumentation: ', -print mibInstrum.writeVars( - (((1,3,6,1,6,3,18,1,1,1,2,109,121,110,109,115), 'mycomm'), - ((1,3,6,1,6,3,18,1,1,1,3,109,121,110,109,115), 'mynmsname'), - ((1,3,6,1,6,3,18,1,1,1,7,109,121,110,109,115), 'volatile')) - ) +print('Remote manager write/create access to MIB instrumentation: '), +print(mibInstrum.writeVars( + ( ((1,3,6,1,6,3,18,1,1,1,2,109,121,110,109,115), 'mycomm'), + ((1,3,6,1,6,3,18,1,1,1,3,109,121,110,109,115), 'mynmsname'), + ((1,3,6,1,6,3,18,1,1,1,7,109,121,110,109,115), 'volatile')) ) +) -print 'Remote manager read access to MIB instrumentation (table walk)' +print('Remote manager read access to MIB instrumentation (table walk)') oid, val = (), None while 1: oid, val = mibInstrum.readNextVars(((oid, val),))[0] if exval.endOfMib.isSameTypeWith(val): break - print oid, val.prettyPrint() + print(oid, val.prettyPrint()) -print 'Unloading MIB modules...', +print('Unloading MIB modules...'), mibBuilder.unloadModules() -print 'done' +print('done') |