![]() I receive AttributeError: 'str' object has not attribute 'prettyPrint' Print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) I do receive the trap, however, when it runs the code print('Var-binds:') # Dispatcher will never finish as job#1 never reaches zero Udp6.domainName, udp6.Udp6SocketTransport().openServerMode(('::1', 162)) TransportDispatcher.registerRecvCbFun(cbFun) TransportDispatcher = AsynsockDispatcher() #print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) Print("Var-binds List: ()".format(str(varBinds))) If reqPDU.isSameTypeWith(pMod.TrapPDU()): Print('Notification message from %s:%s: ' % ( Print('Unsupported SNMP version %s' % msgVer) MsgVer = int(api.decodeMessageVersion(wholeMsg)) ![]() The example code doesn't seem to work correctly for this.įull code: from import AsynsockDispatcherįrom import udp, udp6ĭef cbFun(transportDispatcher, transportDomain, transportAddress, wholeMsg): ![]() I am having issues with getting the key/values from varBinds properly. I'm using python 2.7 and trying to capture SNMP traps using pysnmp.
0 Comments
Leave a Reply. |