0

If these needs to be asked in an existing thread (snmpv3 getone fails while trying via pysnmp (WrongValueError)), that is fine.

However, I am receiving the same error with essentially the same configuration. Receiving the error when using 'authNoPriv' configuration with SHA(1) as the hash.

Traceback (most recent call last):
File "./run_snmp_discovery.py", line 57, in <module>
print(dc.snmpgetv3(cli.mib_oid_index, cli.timeout, cli.retries,
cli.verbose))
File "/root/dev/DiscoverSnmpClient.py", line 266, in snmpgetv3
mib_oid_index['index']))))
File "/usr/lib/python2.7/site-packages/pysnmp/hlapi/asyncore  
/sync/cmdgen.py", line 111, in getCmd
lookupMib=options.get('lookupMib', True)))
File "/usr/lib/python2.7/site-packages/pysnmp/hlapi/asyncore/cmdgen.py", 
line 124, in getCmd
addrName, paramsName = lcd.configure(snmpEngine, authData, 
transportTarget)
File "/usr/lib/python2.7/site-packages/pysnmp/hlapi/lcd.py", line 60, in 
configure
securityName=authData.securityName
File "/usr/lib/python2.7/site-packages/pysnmp/entity/config.py", line  
159, in addV3User
(usmUserEntry.name + (13,) + tblIdx1, 'createAndGo'))
File "/usr/lib/python2.7/site-packages/pysnmp/smi/instrum.py", line 256,   
in writeVars
return self.flipFlopFsm(self.fsmWriteVar, varBinds, acInfo)
File "/usr/lib/python2.7/site-packages/pysnmp/smi/instrum.py", line 239,   
in flipFlopFsm
raise origExc
pysnmp.smi.error.WrongValueError: WrongValueError({'msg':  
WrongValueError(), 'name': (1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1, 5, 5, 0, 0,  
48, 48, 16, 6, 110, 101, 116, 109, 114, 105), 'idx': 3})

Versions:

  • Python 2.7.5
  • pysnmp-4.4.6
  • pyasn1-0.4.4
  • pysmi-0.3.2

Basic debugging is present, values are being passed. USM user was hard coded. Full debugging doesn't provide anything new. This does work with an 'snmpget' against the target host; parameters should meet standards.

Code:

try:
        (errorIndication, errorStatus,
         errorIndex, varBinds) = next(getCmd(SnmpEngine(),
                                 UsmUserData(self.user, 
authKey=self.authpassphrase, privKey=self.privpassphrase,
                                             authProtocol=authprotocol,  
privProtocol=privprotocol, 
securityEngineId=OctetString(hexValue='0000303010')),
                                 UdpTransportTarget((self.host, 
int(self.port)), int(timeout), int(retries)),
                                 ContextData(),

ObjectType(ObjectIdentity(mib_oid_index['mib'], mib_oid_index['oid'],
                                 mib_oid_index['index']))))

securityEngineId seems optional, however I added it having looked at line 60 in /usr/lib/python2.7/site-packages/pysnmp/hlapi/lcd.py.

Any help would be appreciated

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • Revisiting debugging, not sure why this is not being dispatched by snmpEngine. DEBUG: __cookV3UserInfo : ENGINE ID USM USER MibTableRow((1, 3, 6, 1, 6, 3, 15, 1, 2, 2, 1), None) TBL INDEX 1 (25, 128, 0, 79, 184, 5, 83, 84, 79, 86, 76, 78, 88, 51, 49, 55, 53, 46, 99, 111, 114, 112, 57, 232, 48, 152, 6, 110, 101, 116, 109, 114, 105) USM SEC ENTRY MibTableRow((1, 3, 6, 1, 4, 1, 20408, 3, 1, 1, 1, 2, 1), None) TBL INDEX 2 (110, 101, 116, 109, 114, 105) DEBUG: addV3User USERNAME SEC NAME ZERO DOT (0, 0) AUTH usmHMACSHAAuthProtocol PRIV (1, 3, 6, 1, 6, 3, 10, 1, 2, 1) – aaron williams Feb 05 '19 at 17:23
  • Your code is very hard to read. Perhaps you would consider formatting it sensibly? – Lightness Races in Orbit Feb 08 '19 at 11:23
  • that would solve all problems. I'll get right on it. – aaron williams Feb 08 '19 at 15:39

0 Answers0