How to Setup Windows NT SNMP Performance Counter Agent Extension

ID: 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 versions 3.51 and 4.0


SUMMARY

This article 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.


MORE INFORMATION

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

  1. 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 MEM.MIB %systemroot%\SYSTEM32\PERFMIB.INI Memory 300 mem (continued line) Processor 302 proc


    • PERF2MIB creates a PERFMIB.INI file with Memory and Processor counters. The MEM.MIB file is also created. MEM.MIB can be used by SNMP management tools to get 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.


  2. For Windows NT 4.0:


  3. Installing the Performance Counter Agent Extensions 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 should compile Perfmib correctly if run from the NTReskit directory. You may need to change the path for correct location of the Windows NT resource kit on the computer from 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 shows how to setup the Performance Monitor Extension Agent and how to test to see if it was installed correctly:
  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. Try the following test to see if it was successful:

    SNMPUTIL get <agent> public
    .iso.org.dod.internet.private.enterprises.microsoft.software.1.3.1.1.1.1.0




  4. The results should look similar to the following:

    >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

    This particular oid is the maxAvailableBytes object, which returns in integer form.
    Registry Entries / important files

    The following keys are modified when PERMIB.REG is executed using the resource kit utility REGINI.EXE. The files listed are ones that should be copied into the System32 directory and should be checked for if the above 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

    Files that should be copied into the system32 subdirectory are:

    perfmib.dll
    permib.ini
    mib.bin

    If any file is not there, copy it from the NTRESKIT directory to the %SystemRoot%\System32 directory.
    The mib.bin created by the PERF.BAT (listed above) 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 this extension DLL:
    1. Run Registry Editor (REGEDT32.EXE).


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

      \System\CurrentControlSet\Services\SNMP
      \Parameters\ExtensionAgents


    3. Create a new value entry:

      Name: 3
      Type: REG_SZ
      Data: SOFTWARE\Microsoft\Perfmib\CurrentVersion


    4. Create a new key and new value to get the dll name:

      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. 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 nttcp NTSrvWkst
Version : WinNT:3.51,4.0
Platform : winnt
Issue type :


Last Reviewed: January 27, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.