Skip to content
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

Publish and consume SNMP traps (V3) #118

Closed
peternlek opened this issue Jun 17, 2019 · 5 comments
Closed

Publish and consume SNMP traps (V3) #118

peternlek opened this issue Jun 17, 2019 · 5 comments
Labels

Comments

@peternlek
Copy link

Hi, could someone please help me with an issue I have consuming V3 traps? I'm prototyping the use of SharpSnmpLib and have written an agent that creates V3 traps using the following TrapV2Message constructor:

public TrapV2Message(VersionCode version, int messageId, int requestId, OctetString userName, ObjectIdentifier enterprise, uint time, IList<Variable> variables, IPrivacyProvider privacy, int maxMessageSize, OctetString engineId, int engineBoots, int engineTime);

And publishes using the Send extension method:

public static void Send(this ISnmpMessage message, EndPoint manager);

My issue is that I am am not able to decrypt on the listener side. The message is received as a MalformedMessage and I've been attempting to decrypt the encypted scope using the following method call:

var privProvider = new MyDESProvider(new OctetString(_privacyPassword), authenticationProvider);
privProvider.Decrypt(message.EncryptedScope, locParams);

I either get a 'BER exception' thrown or unknown data type.

Could someone please point out what I may be missing or to the location of an example of consuming DES/MD5 protected V3 traps? No privacy information is detailed in the received message so I am having to create security parameters in the listener and I suspect the privacy and/or security parameters of the 'locParams' passed to the '...Decrypt(...)' call above are incorrect.

Also, I've been using the 'Listener' and related classes to listen for V3 traps but I notice that these have been deleted from GitHub, what is the recommended way of listenining for V3 traps?

I've been using SnmpSharpNet and have been able to publish and consume V3 traps with no issues but would prefer to use SharpSnmpLib due to licensing issues.

Thanks,
Peter.

@lextm
Copy link
Collaborator

lextm commented Jun 17, 2019

You might check #83.

@peternlek
Copy link
Author

Thanks for the quick response - this looks like an updated SharpSnmpLib project, is there likely to be a new nuget package at some point? What's the best way of integrating the new code into my project?

@lextm
Copy link
Collaborator

lextm commented Jun 17, 2019

What is the version you are using? Classes related to TRAP processing have been moved to the sample repo, https://github.com/lextudio/sharpsnmplib-samples To use them, simply cut and paste.

@lextm lextm added the question label Jun 17, 2019
@peternlek
Copy link
Author

Thanks, I'm using the v.11.1.0 nuget package. What confuses me is that the Listener classes have been removed from the sharpsnmplib github repository but are used in the recommended samples. I'm used to the code base matching what's in the nuget packages...

@lextm
Copy link
Collaborator

lextm commented Jun 18, 2019

@lextm lextm closed this as completed Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants