Microsoft KB Archive/139488

{|
 * width="100%"|

How to Setup Windows NT SNMP Performance Counter Agent Extension

 * }

Q139488

-

The information in this article applies to:


 * Microsoft Windows NT Workstation versions 3.51, 4.0
 * Microsoft Windows NT Server versions 3.51, 4.0
 * Microsoft Windows NT Resource Kit

-

SUMMARY
The Perf2Mib utility has been removed from the Microsoft Windows NT 4.0 Resource Kit as of Supplement2 and, consequently, future issues concerning the tool are not addressed as this utility is no longer supported by Microsoft.

The Perf2Mib utility is also mentioned in the Windows 2000 Resource Kit. However, the Perf2Mib utility is not included in the Resource Kit and there are no plans to release it in the future.

Many customers who try to use the Perf2Mib utility to create their own Performance Monitor counters for Simple Network Management Protocol (SNMP), can find that their SNMP queries are inconsistent or incomplete. This is because the Perf2Mib utility does not correctly parse the Performance Monitor objects into a .mib file that can be used successfully.

MORE INFORMATION
The following unsupported information explains how to Setup the Windows NT SNMP Performance Counter Agent extension provided in Windows NT Resource Kit versions 3.51 and 4.0. This agent extension makes the performance data counters available through SNMP.

To get the Memory, Processor, Network Segment, and PhysicalDisk Performance Monitor counters through SNMP, you can run Perfm.bat, provided in the Windows NT Resource Kit version 4.0, or follow these steps:

Create a Perfmib.ini configuration file with Perf2mib.exe:


 * This file specifies the performance counters to expose through SNMP and the Object Ids (OID) to access them.
 * Execute the following command:
 * Perf2mib creates a Perfmib.ini file with Memory and Processor counters and a Mem.mib file. Mem.mib can be used by SNMP management tools to retrieve the counters OID.
 * The Perfmib.ini file must reside in the same default directory as the Snmp.exe process, otherwise the Perfmib DDL initialization fails.

For Windows NT 4.0:

When you install the Performance Counter Agent Extensions this makes performance data counters available through SNMP. The installation should be as simple as running Perfm.bat from the NTRESKIT directory, but this batch file has typos and errors and should not be used.

Here is a sample batch file that compiles Perfmib when run from the NTRESKIT directory. You may need to change the path for the correct location of the Windows NT Resource Kit on the computer which this batch file is run:

@echo off

echo "Creating perfmib....."

@echo on

perf2mib perfmib.mib perfmib.ini memory 1 memory processor 2 CPU "Network Segment" 3 net PhysicalDisk 4 disk

@echo off

echo "Compiling perfmib"

@echo on

mibcc -omib.bin -n -t -w2 SMI.MIB LMMIB2.MIB mib_ii.mib perfmib.mib

@echo off

echo "Stopping snmp service"

@echo on

net stop snmp

@echo off

echo "Saving old mib to mib.old...."

@echo on

move %systemroot%\system32\mib.bin %systemroot%\system32\mib.old

@echo off

echo "Copying perfmib files from NTResKit to system32"

@echo on

copy perfmib.dll %systemroot%\system32\perfmib.dll

copy perfmib.ini %systemroot%\system32\perfmib.ini

copy mib.bin %systemroot%\system32\mib.bin

@echo off

echo "Registering new Mibs"

@echo on

regini perfmib.reg

@echo off

echo "Restarting SNMP Service"

@echo on

Step-by-Step Setup and Verification Process
The following information explains how to Setup the Performance Monitor Extension Agent and test the installation. To Setup and test the Performance Monitor Extension Agent, follow these steps:

Save the batch file listed in the previous section as Perf.bat and copy it to the NTRESKIT directory.

Go to an MS-DOS prompt, and then run Perf.bat from the NTRESKIT subdirectory.

Perform the following test:

SNMPUTIL get public

.iso.org.dod.internet.private.enterprises.microsoft.software.1.3.1.1.1.1.0 You may receive the following results:

>snmputil get stevehah3 public

.iso.org.dod.internet.private.enterprises.microsoft.software.1.3.1.1.1.1.0

Variable =

.iso.org.dod.internet.private.enterprises.microsoft.software.1.3.1.1.1.1.0

Value = INTEGER - 757760 In this sample, Smtputil returns the maxAvailableBytes value, which returns in integer form. The maxAvailableBytes represents the Memory-AvailableBytes performance object counter.

This particular Object Identifier (OID) is the maxAvailableBytes object, which returns in integer form.

Registry Entries / important files

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys and Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT or Windows 2000, you should also update your Emergency Repair Disk (ERD).

The following keys are modified when Permib.reg is executed using the Resource Kit utility Regini.exe. Copy the files listed into the System32 directory and verify the preceding steps failed to install the extensions correctly.

From the HKEY_LOCAL_MACHINE subtree:

"\System\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents" Name: MicrosoftPerformanceAgent

Type : REG_SZ

Data: SOFTWARE\Microsoft\PerformanceAgent\CurrentVersion Also under the HKEY_LOCAL_MACHINE subtree:

Key: SOFTWARE\Microsoft\PerformanceAgent\CurrentVersion

Name: Pathname

Type: REG_EXPAND_SZ

Data : %SystemRoot%\System32\perfmib.dll Copy the following files into the System32 subdirectory:

perfmib.dll

permib.ini

mib.bin If any file is not present, copy the file from the NTRESKIT directory to the %SystemRoot%\System32 directory.

The Mib.bin created by Perf.bat (listed earlier) should be 13,024 bytes and the date and time Perf.bat was run. The old Mib.bin should be renamed to Mib.old.

For Windows NT 3.51:

Modify the registry settings to use the following .dll extension:

 Run Registry Editor (Regedt32.exe). From the HKEY_LOCAL_MACHINE subtree, go to the following key: Create a new value entry:  Create a new key and value: Subtree: HKEY_LOCAL_MACHINE

Key Name: \Software\Microsoft\Perfmib\CurrentVersion

Name: Pathname

Type: REG_EXPAND_SZ

Data: %SystemRoot%\System32\perfmib.dll NOTE: Copy this Perfmib.dll from the Resource Kit to the system directory. 

Start the SNMP service.

Add Perfmib.mib to your management station using the method provided by the manufacturer of your management station.

Collect performance counters.

For example, to get the memory counters information with SNMPUTIL tool, issue the following command:

"SNMPUTIL walk agent public .iso.org.dod.internet.private (continued line) .enterprises.microsoft.software.1.3.1.1.300" Where is a blank space (press spacebar).

Additional query words: tcpip

Keywords : kbnetwork

Issue type :

Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT351search kbWinNT400search kbWinNTW351search kbWinNTW351 kbWinNTSsearch kbWinNTS400search kbWinNTS400 kbWinNTS351 kbWinNTRK kbMSPressSearch kbWinNTS351search