Note that there are some explanatory texts on larger screens.

plurals
  1. POPySNMP: load error: Bad OctetString initializer
    primarykey
    data
    text
    <p>I have the following example from the pysnmp page: # GET Command Generator from pysnmp.entity.rfc3413.oneliner import cmdgen</p> <pre><code>errorIndication, errorStatus, \ errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( # SNMP v1 # cmdgen.CommunityData('test-agent', 'public', 0), # SNMP v2 cmdgen.CommunityData('test-agent', 'public'), # SNMP v3 # cmdgen.UsmUserData('test-user', 'authkey1', 'privkey1'), cmdgen.UdpTransportTarget(('localhost', 161)), # Plain OID (1,3,6,1,2,1,1,1,0), # ((mib-name, mib-symbol), instance-id) (('SNMPv2-MIB', 'sysDescr'), 0) ) if errorIndication: print errorIndication else: if errorStatus: print '%s at %s\n' % ( errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex)-1] or '?' ) else: for name, val in varBinds: print '%s = %s' % (name.prettyPrint(), val.prettyPrint()) </code></pre> <p>I made sure that SNMP is running on my machine. I checked in the console with the following command:</p> <pre><code>snmpget -v2c -Cf -c public localhost 1.3.6.1.2.1.1.1.0 </code></pre> <p>Which worked fine. If i execute the python code above I get the following error:</p> <pre><code>SmiError: MIB module "pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py" load error: MIB module "pysnmp/smi/mibs/SNMP-FRAMEWORK-MIB.py" load error: Bad OctetString initializer '[128, 0, 79, 184, 5, 192, 168, 1, 50, 371, 210, 26, 162, 157]' </code></pre> <p>The numbers at the end change with each execution (seems to a timestamp or somehting like that). I'm using python 2.7 and the most recent version of pySNMP (4.2.1). Does anyone know what's the problem with this example code?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload