# How to add an SNMP extension agent to the NT registry

## Summary

After developing a new extension agent DLL, you must configure the registry so that the SNMP extension agent is loaded when the SNMP service is started. This article shows you how.

You can use REGEDT32.EXE to configure the registry, or you can have your SNMP extension agent installation program configure the registry using the Win32 registry APIs.

To configure an SNMP extension agent in the registry, follow these steps:

1. Walk down:

HKEY_LOCAL_MACHINE\
SYSTEM\
CurrentControlSet\
Services\
SNMP\
Parameter\
ExtensionAgents
You'll notice at least one entry like this:
1:REG_SZ:SOFTWARE\Microsoft\LANManagerMIB2Agent\CurrentVersion
Add an entry for the new extension agent. For the SNMP Toaster sample in the SDK, the entry is:
3:REG_SZ:SOFTWARE\CompanyName\toaster\CurrentVersion
This entry provides a pointer to another registery entry (see step 2) that contains the physical path where the extension agent DLL can be found. Note that "CompanyName" and "toaster" strings can be any other meaningful strings that will be used in Step 2.

Note The Windows Vista and Windows Server 2008 SNMP extension agent is located at the following registry entry:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SNMP\Parameters\ExtensionAgents
2. Go to:
HKEY_LOCAL_MACHINE\SOFTWARE
Create keys that correspond to the new entry in step 1:
CompanyName\toaster\CurrentVersion
3. Assign the path of the extension agent DLL as the value to the CurrentVersion key in step 2. For the SNMP toaster sample agent DLL, the entry is:
Pathname:REG_SZ:D:\mstools\samples\snmp\testdll\testdl.dll
4. Note that names and values in the NT registry are case sensitive.
5. Restart the SNMP service from the control panel. The new extension agent DLL will be loaded. Event Viewer in the administrative tools can be used to view errors encountered during the startup process of the SNMP service and extension agents.

## References

SNMP.TXT in the \BIN directory of the Win32 SDK.

Windows NT Resource Guide, Chapters 10-14.