sharpsnmplib icon indicating copy to clipboard operation
sharpsnmplib copied to clipboard

Unable to set ContextEngineId or ContextName for SnmpV3 TrapV2Message

Open Quintinon opened this issue 7 years ago • 1 comments

Context I am attempting to migrate away from a closed-source Snmp solution to SharpSnmpLib and I am trying to match our previous output exactly (when it was already correct).

Problem When using SharpSnmpLib to send SnmpV3 Traps the contextEngineId and contextName are always empty. This was observed in wireshark and seeing that it displayed the contextEngineID as "<MISSING>" and the contextName as "". This was observed on SharpSnmpLib version 9.0.41121.31 on a Windows 10 x64 machine but the source code on GitHub was inspected and the issue still persists.

Potential Solution Expose parameters in the SnmpV3 constructor of the TrapV2Message class that allow for ContextEngineId and ContextName to be set when constructing the Scope of the TrapV2Message.

Notes There is currently a TODO note in the SnmpV3 constructor of the TrapV2Message class where this would need to be changed: https://github.com/lextm/sharpsnmplib/blob/9a297f5151c807a12bdb54bd507a625e8e520c37/SharpSnmpLib/Messaging/TrapV2Message.cs#L149

Quintinon avatar Jan 22 '18 21:01 Quintinon

Related to #60 . Pull request is welcome.

lextm avatar Jan 23 '18 00:01 lextm

This task was done initially in #138. Just accepted the new constructor with modification, and will ship it in the next release.

lextm avatar Feb 06 '24 07:02 lextm