Adding support of SNMP Performance Monitoring on Windows 2000/XP

This HOW TO focuses on the installation of the requires file on a WINDOWS 2000/XP for having access to Windows Operating System and Applications performance object with SNMP.

Remark: A LUTEUS proprietary compilation of the perfmib.mib MIB file is provided as is but it is not guarantee to work on all Windows system. We apologize for any problem that you could encounter but the tools used to generate the file are not longer supported by Microsoft. However successful tests have been performed by us on Windows 2000 and XP.

With this support you will be able to access the following information.

Memory

Memory usage, physical, virtual, paging file ...

Process

Process table statistics, cpu time...

Thread

Thread table statistics, number

system

file system usage

server

Statistic on Server usage

processor

Processor statistics, cpu utilization %, priviliged time usage %, thread count,

Paging File

Memory on disk (Swap) usage

Physical Disk

 Physical Disk usage

Logical Disk

 Logical Disk usage, free space %, busy time %,read queue lenght...

cache

Disk Cache Statistics, cache hits % ....

network Interface

 network Interface Statistics

ICMP protocol

ICMP protocol Statistics, icmp receive/s, icmp error, icmp dest unreach, echo reply/s...

IP protocol

Internet protocol usage, ip data forwarded/s, ip sent/s, ip receive/s...

TCP protocol

Transport Control protocol usage, active connection, , reset, etablished...

UDP protocol

 UDP protocol statistics

nBT

NetBios Over TCPIP protocol

Browser

Server Announcements, duplicate master, election pkt/s, annoucement pkts/s...

nBt connection

NetBios Over TCPIP Connection statistics

NetBEUI

NetBEUI protocol statistics

NetBEUI Resource

 NetBEUI Resource statistics

Print spooler

Print queue statistics

objects

Operating System kernel Object statistics

rAS Port

Remote Access Server statistics

rAS Total

Remote Access Server statistics

redirector

redirector Statistics

server Work Queues

MS MQueue manager statistics

telephony

Statistics

dns

Domain Name Service statistics

dhcp server

Dynamic Host Configuration Protocol

Internet Information Services global

IIS Web server statistics

Terminal Services

Terminal Services Statistics

web service

WEB service Statistics

SMTP Service

Mail service Statistics

Active Directory

Directory service Statistics

job object

Operating System Job Object statistics

On Window 2000/XP the Performance Monitor tool provides support for defining performance objects, performance counters, and object instances, and setting sampling intervals for monitoring data about hardware resources and system services.  

The following example shows a graph of a simple counter, the processor time. 

perfmon

We provide with this how to a set of files that will allow you to add SNMP support to your WINDOWS. Download it if you want to add it. This support is a proprietary configuration and is not compatible with any other configuration made by others companies. If you already have a partial support of performance object, installing this support will erase it. Before installing, check that this support is not already installed on your machine. By default nothing is installed on Windows system.  

Download set of file

The required dll to add to system32 is provided by Microsoft

http://www.microsoft-engineer.com/files/perfmib.dll

Warning: This dll is not longer supported by Microsoft that now uses the WMI infrastructure on Windows 2000 and XP.

The first task is to install the SNMP agent if it is not already installed.

Look at our How_to Install Window SNMP Agent for installation. 

After that, the SNMP agent installed we still cannot answer to SNMP request on the Windows performance objects. The following steps have to be completed before. 

The SNMP agent use a special dll file and an ini file when initializing. By default this file are not provided when installing a Windows 2000/XP system. The perfmib.dll is provided by Microsoft in the Windows NT resource kit. 

Modfify the registry to add the support of performance monitoring. Using RegEdit (or RegEdt32) you will need to add the following keys with their appropriate values to your registry. It is wise to backup your registry before making these changes. 

Go To Tree:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents]
Add String: the next number available in the list
With Value: "SOFTWARE\Microsoft\PerformanceAgent\CurrentVersion" 

Remark: this key will not exist if the SNMP service is not installed on the machine

 Add Key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PerformanceAgent\CurrentVersion]
Add Expandable string : "Pathname"
With Value: "%SystemRoot%\System32\perfmib.dll"

 You can also use the perfmib.reg file to initialize this value.

Before running it open regedit and get the next munber for the ExtensionAgents available. (in our example it is 9). 

Here after the contents of the perfmib.reg 

\Registry\Machine
Software
Microsoft
PerformanceAgent
CurrentVersion
Pathname = REG_EXPAND_SZ %SystemRoot%\System32\perfmib.dll
System
CurrentControlSet
Services
   SNMP
  Parameters
ExtensionAgents
                 9 = SOFTWARE\Microsoft\PerformanceAgent\CurrentVersion 

Next run the regini perfmib.reg command in a dos session. This will add the missing registry keys. 

By adding these keys you will be configuring the perfmib.dll as an SNMP Extension Agent. The Windows SNMP Service is quite extensible. When the service is started, it queries for the existence of each Extension Agent and the MIB tree that each Agent supports. Based on the MIB tree result set that the SNMP Agent gets at startup determines what OIDs are exposed during an SNMP walk.  

Remark: If there's a broken SNMP Extension Agent DLL, the walk may break because the SNMP Agent currently relies on the Extension Agent DLL to respond accordingly. 

Stop the SNMP service. Use the Net stop SNMP service

Or open the services window by clicking in services in the control panel -> administration Tool window 

Copy the provided file (perfmib.dll, perfmib.ini) into to the system32/ subdirectory of Windows. 

Restart the SNMP service with a net start SNMP service. Check in the Event log that your SNMP service is well restarded and that not error occurs. 

The following screen shot shows a problem when trying to load our mib file. In fact the registry was not correctly setup.

event properties

 Copy the perfmib.mib into the /bin/mibs of LoriotPro

Compile the new file with the Mib compiler of LoriotPro. To compile a new mib refer to LoriotPro documentation. The compiler is accessible in the MIB menu. You have to scan (the subdirectory /mibs) for discovering the perfmib.mib file. Then browse the list, find it and press the compile this file button. Or browse manually your directory and select the file and ckick on compile this MIB file (following screeshot).

 perfmib.mib

 After this compilation you could open your MIB tree, and in the search bar enter Microsoft and press the MIB Tree button

 You should be able to see the Microsoft MIB performance objects.

 Mib Tree

 To check that your mib is well installed, first select in the directory tree the host object where you have installed the perfmib files, then select the Microsoft MIB memory object and from the LoriotPro contextual menu start the walk sub tree option. 

The perfmib.mib is visible as a LoriotPro WEB report in this site for information

After walking the MIB output window opens with all the objects and their current values.

Mib walk

Warning : Due to incorrect Object answer the MIB walking doesn’t work on all objects.

Do a simple get to check that the object answer.

Consult the following HOW TO for using these new MIB object. 

How to add performance objects to the Mib file

In our example, the perfmib.mib and perfmib.ini file contain the description of the performance object exposed to SNMP request. Those files were created using perf2mib.exe. The ini file contain a list a all the object that will be accessible with SNMP. The Mib file is used on the SNMP manager to send request to the Windows SNMP agent. 

The perfmib.mib provided with this How To do not contain all the performance object. 

If there are other Performance Monitor objects that you would like to reach from SNMP it is necessary to recreate these files with the perf2mib.exe program. 

Typically you add performance object that are available under the Window performance monitor tool. The following screen shot shows the various counters for the memory performance object. 

Perfmon 

 The syntaxe of perf2mib:

perf2mib MIB_filename INI_filename [Object_name MIB_index MIB_prefix]

Object_ name is the name of the performance object
MIB_filename is the name of the mib file. We use perfmib.mib as file name
INI_filename is the name of the ini file. We use perfmib.ini as file name
Object_name is the name of the performance objet available in the upper screenshot
MIB_index is the index of the set of mib object. Use sequenced number.
MIB_prefix is the prefix use in front of the objet in the mib. We set here what we want

Note that the OID reference is flexible under the performance tree depending on the parameters MIB_index you feed perf2mib.exe.  

We give you here the steps we use to create the set of file perfmib.mib and perfmib.ini. 

We first created a batch file called genperf.bat.

 

perf2mib perfmib.mib perfmib.ini memory 1 MS-mem- process 2 MS-proc- thread 3 MS- system 4 MS-sys- server 5 MS-serv- processor 6 MS-procsr- "Paging File" 7 MS-paging- physicaldisk 8 MS-pdisk- logicaldisk 9 MS-logdsk- cache 10 MS-cach- iCMP 12 MS-icmp- iP 13 MS-ip- tCP 14 MS-tcp- uDP 15 MS-udp- browser 16 MS-brow- "nBT Connection" 17 MSnbtcon netBEUI 18 MS-nbeuinet- "netBEUI Resource" 19 MS-nbeuir- "Print queue" 20 MS-spool- objects 21 MS-obj- "rAS Port" 22 MS-rasprt- "rAS Total" 23 MS-rastot- redirector 24 MS-redir- "server Work Queues" 25 MS-swq- telephony 26 MS-tele- "DNS" 27 MS-dns- "dhcp server" 28 MS-dhcp- "Internet Information Services Global" 29 MS-IIS- "terminal Services" 30 MS-tsrv- "terminal Services Session" 31 MS-tsses- "Active Server Pages" 32 MS-asp- "ftp Service" 33 MS-ftp- "web service" 34 MS-web- "smtp server" 35 MS-smtp- "NTDS" 36 MS-ActiveDir- "IAS authentication server" 37 MS-iias- "job object" 38 MS-jobo-

echo off
REM memory 1 MS-mem-
REM process 2 MS-proc-
REM thread 3 MS-
REM system 4 MS-sys-
REM server 5 MS-serv-
REM processor 6 MS-procsr-
REM "Paging File" 7 MS-paging-
REM physicalDisk 8 MS-pdisk-
REM logicalDisk 9 MS-logdsk-
REM cache 10 MS-cach-
REM "network Interface" 11 MS-netint-
REM iCMP 12 MS-icmp-
REM iP 13 MS-ip-
REM tCP 14 MS-tcp-
REM uDP 15 MS-udp-
REM browser 16 MS-brow-
REM "nBT Connection" 17 MS-nbtcon-
REM netBEUI 18 MS-nbeuinet-
REM "netBEUI Resource" 19 MS-nbeuir-
REM "print spooler" 20 MS-spool-
REM objects 21 MS-obj-
REM "rAS Port" 22 MS-rasprt-
REM "rAS Total" 23 MS-rastot-
REM redirector 24 MS-redir-
REM "server Work Queues" 25 MS-swq-
REM telephony 26 MS-tele-
REM dns 27 MS-dns-
REM "dhcp server" 28 MS-dhcp-
REM "Internet Information Services global" 29 MS-IIS-
REM "terminal Servives" 30 MS-tssrv-
REM "terminal Services Session" 31 MS-tsses-
REM "Active Server Pages" 32 MS-asp-
REM "ftp Service" 33 MS-ftp-
REM "web service" 34 MS-Web-
REM "SMTP Service" 35 MS-smtp-
REM NTDS 36 MS-ACtiveDir-
REM "IAS authentication server" 37 MS-iias-
REM "job object" 38 MS-jobo-
echo on

The REM here are only convenient for adding new performance object to the perf2mib command line. 

Run the .bat file in a dos session. 

Remark : We use prefix that we define ourself. Within LoriotPro when you call object by their OID name the name should exactly fit. If you call the OID with the numeral value the name as no impact and could be change later on.

Warning : The MIB index is created when running perf2mib. The index for the same object could change from one generation to another, if you shift the index value. If you add new object do not insert it or replace existing object, add to this end of the list and use the next index number available.

Warning: Make a backup of your previous perfmib.mib and perfmib.ini file before running genperf.bat. This avoids overwriting them. 

Warning: The perfmib.mib file and the perfmib.ini file are link and could not be disjoint. The same ini file should be installed on all the Windows system (server and station) within the same company. The mib file generated with the ini file should be installed on the management station (LoriotPro). 

Then get the files perfmib.ini and perfmib.mib and proceed to the installation as previously defined.