-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trap receiver throws exception #107
Comments
First, @aschamberger - in your code: Your callback needs to be async (and, it's missing a trailing colon). Fixing that block: async def callback(trap):
print(trap) Then, there is an issue within the library here that also needs to be fixed. Referencing: Lines 889 to 904 in 18acb9a
I don't believe the cast type on line # 900 is correct, as I think the quickest and one of the more correct fixes here is to fix the cast on the same line to instead cast the entire sequence, However, then Combined, this should be a proper fix: obj = cast(Tuple[Integer, OctetString, Trap], as_sequence) Finally - I'd have too many questions for @exhuma here - but to start with, I think it would be nice to make more information around the larger trap that was received to the callback. I.E., I'd like to still at least have a supportable option for getting back the SocketInfo (for knowledge of the IP address and port that the trap was sent from), the community, and even the SNMP version indicator for potential consideration and use within the callback. |
Issue Description
I tried to implement a trap receiver and it raises the following exception:
My code:
HexDump
The text was updated successfully, but these errors were encountered: