windows-server-2008snmpsharpnet

Capturing SNMP traps when snmptrap.exe is running


I've just implemented a small Windows service which captures SNMP traps using snmpsharpnet. (It's implemented in C#)

However to my dismay I've just discovered that all our servers have snmptrap.exe running in Windows (2008 R2).

So now my question is: How do I go about handling this problem ?

Can you interact with snmptrap.exe through some kind of API, or do I have to stop snmptrap.exe ? (which I'd really rather not, as I'm not certain it's not used)

Anyone has a good approach to this ?


Solution

  • Finally found out there is an API for snmptrap: http://msdn.microsoft.com/en-us/library/windows/desktop/aa377986(v=vs.85).aspx

    However I've found no way to P/Invoke it, so I'd have to make a C++ library with a CLI wrapper around it. This would clearly solve my problem, however the company decided on not spending the ressources on it, so I won't be looking further into the matter at the moment.

    Still I'm confident this is the way to solve the problem, hence I've answered my own question.