title: pysnmp snmp get with managed objects
body: <p>I'm trying to figure out how to load mibs and get the sysObjectID of a cisco switch and then resolve it into something human readable. Right now my code works but what is confusing me is are the arguments for getCmd(), instead of sending a string with OID how do I send a managed object?</p>
  
  <p>how can I change the following line in my code</p>
  
  <pre><code>'1.3.6.1.2.1.1.2.0',
  </code></pre>
  
  <p>To be something like 'sysObjectdID.0' but as a managed object</p>
  
  <pre><code>#!/bin/env python
  from pysnmp.entity.rfc3413.oneliner import cmdgen
  from pysnmp.smi import view
  from pysnmp.smi.rfc1902 import ObjectType, ObjectIdentity
  
  cmdGen = cmdgen.CommandGenerator()
  print "Loading &amp; Indexing MIB Modules..."
  mibBuilder = cmdGen.snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder
  mibPath = mibBuilder.getMibPath() + ('/Users/jeffrey.dambly/Documents/mibs',)
  mibBuilder.setMibPath(*mibPath)
  cmdGen.snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.loadModules('CISCO-SMI', 'CISCO-PRODUCTS-MIB')
  
  mibView = view.MibViewController(mibBuilder)
  
  print 'Done'
  #print 'MIB symbol name lookup by name: '
  #oid, label, suffix = mibView.getNodeName((1, 3, 6, 1, 4, 1, 9, 1, 12))
  #print oid, label, suffix
  print 'Done'
  
  errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd(
      cmdgen.CommunityData('xxxxxxxx'),
      cmdgen.UdpTransportTarget(('192.168.8.10', 161)),
      '1.3.6.1.2.1.1.2.0',
      lookupNames=True,
      lookupValues=True,
  )
  
  # Check for errors and print out results
  if errorIndication:
      print(errorIndication)
  else:
      if errorStatus:
          print('%s at %s' % (
              errorStatus.prettyPrint(),
              errorIndex and varBinds[int(errorIndex)-1] or '?'
              )
          )
      else:
          for name, val in varBinds:
              print('%s = %s' % (name.prettyPrint(), val.prettyPrint()))
  </code></pre>