How to Setup Windows NT SNMP Performance Counter Agent Extension

Q139488


The information in this article applies to:


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:

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


  2. For Windows NT 4.0:


  3. 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:
  1. Save the batch file listed in the previous section as Perf.bat and copy it to the NTRESKIT directory.


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


  3. Perform the following test:


  4. SNMPUTIL get <agent> 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:

    1. Run Registry Editor (Regedt32.exe).


    2. From the HKEY_LOCAL_MACHINE subtree, go to the following key:


    3. \System\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents
    4. Create a new value entry:


    5. Name: 3
      Type: REG_SZ
      Data: SOFTWARE\Microsoft\Perfmib\CurrentVersion
    6. 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.


  5. Start the SNMP service.


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


  7. Collect performance counters.


  8. For example, to get the memory counters information with SNMPUTIL tool, issue the following command:
    SNMPUTIL walk agent public<space>.iso.org.dod.internet.private (continued line) .enterprises.microsoft.software.1.3.1.1.300
    Where <space> 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


Last Reviewed: October 23, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.