SNMP Files on the SDK

The Windows Systems Developers Kit (SDK) is a set of libraries, header files, tools, books, online Help, and sample source programs to help you create Windows applications. The Windows NT SDK contains SNMP files, tools, and information in the following directories:

Directory

File

Description

\DOC\MISC

PROGREF.RTF

Microsoft Windows/NT SNMP Programmer's Reference

\MSTOOLS\BIN\WINNT

DHCP.MIB

Microsoft proprietary MIB for DHCP, described in the section "MIB Object Types for Windows NT" in Appendix A

LMMIB2.MIB

LAN Manager MIB II, described in the section "MIB Object Types for Windows NT" in Appendix A

MIB_II.MIB

This MIB is described in RFC 1213 and the section "MIB Object Types for Windows NT" in Appendix A

SMI.MIB

This MIB is described in RFC 1155

SNMP.TXT

Notes on SNMP development for Windows NT — incorporated into this chapter

TOASTER.MIB

MIB for the sample extension-agent TESTDLL.DLL

WINS.MIB

Microsoft proprietary MIB for WINS, described in the section "MIB Object Types for Windows NT" in Appendix A

\MSTOOLS\BIN\WINNT\
ALPHA, I386, and MIPS

MIB.BIN

Output from the MIB compiler

\MSTOOLS\BIN\WINNT\
ALPHA, I386, and MIPS

MIBCC.EXE

MIB compiler, described in PROGREF.RTF

\MSTOOLS\SAMPLES\
WIN32\WINNT\SNMP\
SNMPUTIL

SNMPUTIL.C

Example of how to code management applications using the SNMP Management APIs for Windows NT

\MSTOOLS\SAMPLES\
WIN32\WINNT\SNMP\
TESTDLL

*.*

Example of how to structure an extension-agent DLL that works in conjunction with the Windows NT SNMP agent.


SNMP Source Code

There are two sets of sample code on the SDK.

SNMPUTIL

The files in the SNMPUTIL directory contain the source code for the SNMPUTIL.EXE utility. This utility will allow you to retrieve data from any SNMP agent.

To use the utility, type snmputil with the appropriate switches:

snmputil [get|getnext|walk] agent community oid [oid]

or

snmputil trap

Where:

get

Gets the current value of the specified oid(s).

getnext

Gets the current value of the item in the MIB that follows the item whose oid is specified.

walk

Steps through the MIB and retrieves the values of all items in the branch of the MIB specified by oid.

agent

Specifies the computer to query. This can be an IP address, an IPX address, or a hostname.

community

Specifies a community name, which is used to group computers together into management groups.

oid

The ASN.1 name of the variable being queried, of the form .N.N.N.N (that is, a string of numbers separated by periods or, alternately, a string of names separated by periods). See the section "Application is Unable to Get Requested Variables" under "Troubleshooting SNMP" earlier in this chapter for more information about this parameter.

trap

Tells SNMPUTIL to listen for traps.

For example:


snmputil get jb486 public
    .iso.org.dod.internet.mgmt.mib2.system.sysDescr.0

Would return a text description of the type of computer hardware and software being used on the computer named jb486.

TESTDLL

The files in the TESTDLL directory are the sources for the TESTDLL.DLL. This DLL implements the toaster MIB. See the next section, "SNMP Information in the Registry," for information about installing this DLL.

MIBs and the MIB Compiler

You can use the MIB compiler, MIBCC.EXE, to compile your own private MIBs. The file MIB.BIN must be placed in the path for the SNMP Manager APIs to be able to function properly. MIBCC.EXE by default places the file MIB.BIN in the <WINDIR>\SYSTEM32 directory.

The Microsoft Windows NT SNMP Programmer's Reference document describes the usage of the MIB compiler, which creates the file MIB.BIN that the SNMPUTIL.EXE program uses.