title: pysnmp v3 GETBULK
body: <p>I currently have a script which polls multiple oids on multiple devices using PySNMP. It reads the list of hosts in from a file and for some hosts needs to poll 3 or 4 oids, at the moment it is doing this sequentially, so to make it more efficient I want to do a getbulk so I'm only polling each host once. </p>
  
  <p>I've done multiple searches on this and can find plenty of examples using pysnmp and snmp v2 but I can't find an example with snmpv3. I've tried the test script below but it's throwing up an error so can someone take a look and let me know what I'm doing wrong please? My test script looks like this:</p>
  
  <pre><code>from pysnmp.entity.rfc3413.oneliner import cmdgen
  host='10.0.0.1'
  incount = '.1.3.6.1.2.1.31.1.1.1.6.16'
  outcount ='.1.3.6.1.2.1.31.1.1.1.10.16'
  
  errorIndication, errorStatus, errorIndex,
  varBindTable = cmdgen.CommandGenerator().bulkCmd(
                  UsmUserData('snmp_user', 'password', 'password',
                            authProtocol=usmHMACSHAAuthProtocol,
                            privProtocol=usmAesCfb128Protocol),
                  UdpTransportTarget((host, 161)),         
              0,    
              25,
              (incount),
              (outcount),
          )
  
  if errorIndication:
     print errorIndication
  else:
      if errorStatus:
          print '%s at %s\n' % (
              errorStatus.prettyPrint(),
              errorIndex and varBindTable[-1][int(errorIndex)-1] or '?'
              )
      else:
          for varBindTableRow in varBindTable:
              for name, val in varBindTableRow:
                  print '%s = %s' % (name.prettyPrint(), val.prettyPrint())
  </code></pre>
  
  <p>and the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "./multiget.py", line 7, in &lt;module&gt;
      errorIndication, errorStatus, errorIndex, 
  NameError: name 'errorIndication' is not defined
  </code></pre>
  
  <p>It's pretty much falling at the first hurdle so I've evidently got the syntax wrong, but like I say, I couldn't find an example of this with snmpv3.</p>
  
  <p>Thanks</p>
  
  <p>Ed</p>