Link to home
Start Free TrialLog in
Avatar of DickJansen
DickJansen

asked on

Retrieving SNMP trap destinations from Windows

Hello,

I am currently developing a C# program to detect/monitor USB activity.  If certain a certain device that I don’t want to be plugged in, gets plugged in, then the program will shoot off an SNMP trap to 4 servers that I specified in the code.  SNMP is enabled on the Windows 7 machine, but the program doesn’t use any of this as I have the UDP packet generation in the code.  I will be installing this on A LOT of machines, and realized that in the future it is going to be a pain if the 4 servers change.  I would have to update the code and reinstall the program on each machine.  

I have SNMP configured on the machines themselves with the same trap destination information that is in the code, but it is much easier to push out a change on that if the IP addresses of the servers were to change in the future.    Is there any way to pull in the “Trap Destinations” that I have set in Windows as a variable in my code?  If so, where is that information stored?  That way I could just push out a change to the SNMP configuration and the program would automatically work with the changes.

Sorry if this isn’t very clear…

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Rory de Leur
Rory de Leur
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DickJansen
DickJansen

ASKER

This is more of the information I was looking for, but I will accept yours as a possible solution

http://msdn.microsoft.com/en-us/library/aa915250.aspx

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\public

KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\mycommunity

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapVersion

I was really looking to get away from fixed FQDN entries in the code as those are likely to change at some point.