SNMP, NT, and MIBs To get the performance Counters via SNMP use the following steps. (most of the necessary files are found in the NTReskit) 1. Create a PERFMIB.INI configuration file using PERF2MIB.EXE of syntax perf2mib MIBfilename INIfilename [ObjectName MIBIndex MIBPrefix [...]] Where: MIBfilename Is the name of the MIB file to be created. INIfilename Is the name of the generated configuration file. This file is used by the SNMP extension agent to map performance counters to MIB variables. ObjectName Is the name of the performance counter object whose counters you want to expose (such as "Processor," "Memory," and so on). Note: that ObjectName is case sensitive. If it contains imbedded spaces, as in "MSExchangeMTA Connections," it must be enclosed in quotation marks ( "" ). MIBIndex Is the numeric ID of the MIB branch where this particular object's data should be placed. MIBPrefix Is the abbreviation that should be placed before counter names belonging to this object (such as "mem" for Memory counters, "proc" for Processor counters, and so on. These values must be unique). Note: The last three parameters can be repeated to map multiple object types with one call. For example: To create a configuration file for memory counters you would type perf2mib mem.mib mem.ini Memory 1 mem You can create a separate MIB file for each counter or you can create one MIB from all of the performance counters. It would look something like: perf2mib perfmib.mib perfmib.ini Memory 1 mem Processor 2 procrs Process 3 proc .... etc The nice thing about creating one all encompassing MIB is that it is easier to load in Netview and compile using MIBCC.EXE. 2. Run the utility MIBCC.EXE to compile the MIB and create the MIB.BIN file. mibcc [-?] [-e] [-l] [-n] [-o] [-t] -[w] [files...] Where: -ex stops after x errors. (Default = 10) -l does not print logo. -n prints each node as it is added. -ofilename outputs filename. (Default = MIB.BIN) -t prints the MIB tree when finished. -wx sets warning level of x, where 1=errors and 2=warnings. files specifies the source filenames. -? displays help. The MIB compiler converts the readable MIB files into a data format that is more easily read by the SNMP Management API. Although the output ( -o switch ) of mibcc.exe may have any valid name, the Management API will only recognize the MIB.BIN file. The file itself is a binary record format file that contains the compiled collection of MIBs used on the local machine. THIS MEANS THAT YOU MUST HAVE ALL MIB FILES COMPILED INTO A SINGLE MIB.BIN FILE. The output of MIBCC.EXE is not an entire compiled MIB module. Information about each node's SYNTAX, ACCESS, STATUS, and DESCRIPTION clause is not stored in the MIB.BIN file, because the Management API does not require this information. For example: mibcc -oc:\temp\mib.bin -n -t -w2 c:\temp\smi.mib c:\temp\LMMIB2.MIB c:\temp\mib_II.mib c:\temp\perfmib.mib ... (other MIBs) It is sometimes helpful to output the contents of the above command to a file for later viewing. You can look at the file to see what errors occurred and to make sure that all the MIBs were registered properly. More importantly, by using the -t option, you will receive the printout of the MIB tree so you can see where the MIBs are located. Note: You must compile the MIBs in order of there dependencies. A MIB is dependent on another MIB if its highest node is defined in another MIB. For example, if you look at the IMPORTS section of the dhcp.mib, you see that it is dependent on wins.mib, RFC1155-SMI, and RFC1213-MIB. Therefor some of the definitions in dhcp.mib are based on what was defined in earlier MIB definitions. Without compiling these MIBs first, the Microsoft compiler has no way of linking these definitions. Fortunately NetView's does not have this problem. DHCP.MIB imports section looks like: IMPORTS enterprises, OBJECT-TYPE FROM RFC1155-SMI DisplayString FROM RFC1213-MIB microsoft, software FROM WINS-MIB; The reverse is also true. When you go to load your MIBs in Netview, you must make sure that you load in the correct order or all necessary MIBs are already present. If you have the book "Netview Administrator's Guide version 5", then read chapter 7. This will describe in more detail about loading MIB and collecting information 3. Stop the SNMP agent ("net stop SNMP"). 4. Rename %SYSTEMROOT%\SYSTEM32\MIB.BIN to MIB.OLD. 5. Copy the following files to the %SYSTEMROOT%\SYSTEM32 folder: PERFMIB.INI (created when you ran PERF2MIB.EXE if you made a global perfmib.mib) MIB.BIN (created when you ran MIBCC.EXE) PERFMIB.DLL (This is the extension dll that will process the SNMP requests and return Performance Counters. This dll is hard to find. I found it on NTReskit supplement 2.) 6. Register PERFMIB.REG in the Registry (this file is located in the NT resource Kit). Or simply add the following entries to the registry manually. \HKEY_LOCAL_MACHINE \Software \Microsoft \PerformanceAgent \CurrentVersion \Pathname = REG_EXPAND_SZ %SystemRoot%\System32\perfmib.dll \System \CurrentControlSet \Services \SNMP \Parameters \ExtensionAgents \MicrosoftPerformanceAgent = SOFTWARE\Microsoft\PerformanceAgent\CurrentVersion 7. Restart the SNMP agent ("net start SNMP"). 8. Add "PERFMIB.MIB" to the management station (and any other necessary MIBs.) 9. Now you should be able to query the NT Performance MIBs. Note: Once you have compiled your performance MIB on one NT machine, you do not need to repeat the process on every machine. All you need to do is copy the correct files to each NT machine, add the registry values, and stop and start the SNMP service.