Closed JorgeJuanTel closed 5 years ago
That feels like a bug... If you can share debug log produced when snmpfwd-server.py --debug-asn1
command-line option is given, that would be helpful. Keep in mind that your SNMP keys can appear in the log.
Here I attach the log file generated by snmpfwd-server with the command-line option --debug-asn1=all
Thank you
I am trying to find what's wrong here, but it's not obvious. The failure occurs after TRAPv1 PDU turned into TRAPv2c PDU, then everything blows up on new PDU serialization attempt...
Any chance you could share a raw tcpdump packet containing the original TRAPv1 message causing this havoc? ;-)
Hold on, could you please try this pysnmp commit or just HEAD of this branch? I hope that fixes this crash. I'd make pysnmp release if that helps.
With that new version of pysnmp, it works now. Thank you very much. Sorry for not answering before, last week I wasn't in the office.
Best regards, Jorge Juan Fernando
Also cherry-picked to master.
Hi
I'm trying to configure SNMP Proxy Forwarder to receive SNMPv1 TRAPs and forward them as SNMPv3 TRAPs. But when the server receives a SNMPv1 TRAP, it fails with the next error:
2019-07-16 11:28:46,442 ERROR poll error: Traceback (most recent call last): ; File "c:\program files\python37\lib\site-packages\pysnmp\carrier\asyncore\dispatch.py", line 46, in runDispatcher use_poll=True, map=self.sockMap, count=1) ; File "c:\program files\python37\lib\asyncore.py", line 207, in loop poll_fun(timeout, map) ; File "c:\program files\python37\lib\asyncore.py", line 150, in poll read(obj) ; File "c:\program files\python37\lib\asyncore.py", line 87, in read obj.handle_error() ; File "c:\program files\python37\lib\asyncore.py", line 83, in read obj.handle_read_event() ; File "c:\program files\python37\lib\asyncore.py", line 422, in handle_read_event self.handle_read() ; File "c:\program files\python37\lib\site-packages\pysnmp\carrier\asyncore\dgram\base.py", line 170, in handle_read self._cbFun(self, transportAddress, incomingMessage) ; File "c:\program files\python37\lib\site-packages\pysnmp\carrier\base.py", line 70, in _cbFun self, transportDomain, transportAddress, incomingMessage ; File "c:\program files\python37\lib\site-packages\pysnmp\entity\engine.py", line 152, in receiveMessageCbFun self, transportDomain, transportAddress, wholeMsg ; File "c:\program files\python37\lib\site-packages\pysnmp\proto\rfc3412.py", line 433, in receiveMessage PDU, maxSizeResponseScopedPDU, stateReference) ; File "C:\Program Files\Python37\Scripts\snmpfwd-server.py", line 256, in processPdu msgId = trunkingManager.sendReq(trunkId, trunkReq, self.trunkCbFun, cbCtx) ; File "c:\program files\python37\lib\site-packages\snmpfwd\trunking\manager.py", line 32, in sendReq return trunk.sendReq(req, cbFun, cbCtx) ; File "c:\program files\python37\lib\site-packages\snmpfwd\trunking\client.py", line 53, in sendReq self.send(protocol.prepareRequestData(msgId, req, self.secret)) ; File "c:\program files\python37\lib\site-packages\snmpfwd\trunking\protocol.py", line 114, in prepareRequestData r['snmp-pdu'] = encoder.encode(req['snmp-pdu']) ; File "c:\program files\python37\lib\site-packages\pyasn1\codec\ber\encoder.py", line 763, in call substrate = concreteEncoder.encode(value, asn1Spec, self, options) ; File "c:\program files\python37\lib\site-packages\pyasn1\codec\ber\encoder.py", line 97, in encode value, asn1Spec, encodeFun, options ; File "c:\program files\python37\lib\site-packages\pyasn1\codec\ber\encoder.py", line 544, in encodeValue chunk = encodeFun(component, asn1Spec, **options) ; File "c:\program files\python37\lib\site-packages\pyasn1\codec\ber\encoder.py", line 763, in call substrate = concreteEncoder.encode(value, asn1Spec, self, options) ; File "c:\program files\python37\lib\site-packages\pyasn1\codec\ber\encoder.py", line 97, in encode value, asn1Spec, encodeFun, options ; File "c:\program files\python37\lib\site-packages\pyasn1\codec\ber\encoder.py", line 162, in encodeValue if value == 0: ; File "c:\program files\python37\lib\site-packages\pyasn1\type\univ.py", line 241, in eq__ return self._value == value ; File "c:\program files\python37\lib\site-packages\pyasn1\type\base.py", line 199, in plug raise error.PyAsn1Error('Attempted "%s" operation on ASN.1 schema object' % name) ;pyasn1.error.PyAsn1Error: Attempted "eq" operation on ASN.1 schema object caused by <class 'pyasn1.error.PyAsn1Error'>: Attempted "eq" operation on ASN.1 schema object
My configuration files are the next: