SNMP Information in the Registry

SNMP parameters are contained in the Registry, and so is the information about which extension-agent DLLs SNMP loads. To examine or change information in the Registry, use the REGEDT32.EXE program that comes with Windows NT.

SNMP Parameters

This section lists Windows NT SNMP network parameters. These parameters are contained in the Registry in the following key:

HKEY_LOCAL_MACHINE\
SYSTEM\
CurrentControlSet\
Services\
SNMP\
Parameters

Registry parameter

Description

EnableAuthenticationTraps
Units: Boolean
Range: 0 (off) or 1 (on)
Default: on

A value of On (1) indicates that the SNMP service sends a trap whenever it receives a request that does not match any community name or host filter in its lists. Off (0) indicates that the SNMP service does not send a trap when this occurs.

ExtensionAgents

Contains information about each of the extension-agent DLLs to load. See the next section "SNMP Extension Agent Information."

ValidCommunities
Units: names
Range: —
Default: public

Specifies one or more community names defining groups of hosts from which the SNMP service will accept requests.

TrapConfiguration
Units: name
Range: —
Default: —

Specifies one or more host names, IP addresses, or IPX addresses defining hosts to which the SNMP service sends traps. Under the TrapConfiguration key, there is a key for each community. Under the community key, there are trap destination values for that community.


SNMP Extension Agent Information

If you are developing an extension-agent DLL, you must configure the Registry so that the SNMP agent will load the extension-agent DLL. You can use the REGEDT32.EXE program that comes with Windows NT to add this information, or you can have your SNMP extension-agent installation program configure the Registry using the Win32 Registry APIs.

These are the steps to configure an SNMP extension-agent in the Registry.

1. Locate the following key:

HKEY_LOCAL_MACHINE\
SYSTEM\
CurrentControlSet\
Services\
SNMP\
Parameters\
ExtensionAgents

2. For the new extension-agent, create a value under this key with a Value Name of the next available integer and a type of REG_SZ. 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 Registry entry (see next step), which contains the physical path where the extension-agent DLL can be found. The "CompanyName" and "toaster" strings are used in the next step.

3. Locate the following key:

HKEY_LOCAL_MACHINE\SOFTWARE

and create a CompanyName\toaster\CurrentVersion key that corresponds to the new entry in step 2. The keys Microsoft\RFC1156Agent\CurrentVersion and Microsoft\LANManagerMIB2Agent\CurrentVersion show the format of the information.

4. Assign the path of the extension-agent DLL as the value for the CurrentVersion key. Remember that the names and values in the Windows NT Registry are case sensitive.

For instance, if you have copied the SNMP toaster sample agent DLL to drive D, the entry is:

Pathname:REG_SZ:D:\mstools\samples\snmp\testdll\testdll.dll.

5. Stop and restart the SNMP service from the Control Panel Services icon. You need to do this for the SNMP agent to load the new extension agent that you have just added to the system.

You can use Event Viewer in the Administrative Tools program group to view errors encountered during the startup process of the SNMP service and extension agents.

Note

The key name and values are case sensitive. Make sure that they match. If you have problems, look in the system log. You can also type "Net Help Start SNMP" to see how to configure error logging of the SNMP agent.

You must stop and restart the SNMP service for it to load the new extension-agent DLLs.