Most recent post

Saturday, January 26, 2008

Freeware - PerfCollector

PerfCollector is a command line freeware tool (with .NET source) that can monitor performance counters and log values to a text file. It can use either WMI or standard Performance Counters. See a previous blog post on more information about why this tool was developed.
  • Freeware - with source included.
  • Command line driven - This allows the tool to be scheduled. The PerfCollector tool has no UI. All activity is driven by a config.xml file with errors and logs to text files. Additionally it has a Debug entry in the Config.xml which allows you to see the actions being performed, additionally any errors are dumped into a \Trace\ folder. Program terminates on any exceptions.
  • Logs performance counter values to text file - Allows the configuration of Performance Counters and then dumps the values of those counters (only if they have changed) to a log file that can then be parsed using LogParser.
  • Different monitor settings - Monitors performance counters via either WMI Events or standard Performance Counters.

Download. VB.NET source is included in download.

*************************************************
To install:
1. Copy the PerfCollector folder to a location on your harddrive
2. Configure an XML file. See CONFIG.XML for an example
3. Open a command prompt and type 'PerfCollector.exe '
4. Select 'E' (capital e) to stop.

Additionally to run as a Windows Service see the .\InstallAsAService\InstallAsAService.bat batch file which has a script to allow you to install as a service using the SRVANY and INSTSRV resource kit tools (which can be downloaded for free from Microsoft)
*************************************************

Config file structure

config
counters
counter
... many counter

Below are the attributes of Counters element

  • Timer - How often the tool should poll the performance counters, or how often WMI should check for changes. Lower values will impact CPU performance. Timer is in milliseconds. e.g. 5000
  • MonitorType - Either 'WMI' for WMI monitoring or 'PerfMon' for PerfMon style montioring.
  • Debug - Sets level of verbose logging. True for verbose, false for no debugging.

Below are the attributes of the Counter element

  • CategoryName - This is the PerfMon Category name of the Performance Counter.
  • CounterCountName - This is the Performance Counter that contains a increasing total counter. e.g. TotalExecutedCalls
  • CounterName - This is the Performance Counter that contains the value you are interested in. e.g. "Call Time Last"
  • CategoryWMIName - This is the WMI Performance Counter Name. Find this using steps in the previous post. e.g. "Win32_PerfRawData_CustomAppWindows_CustomAppWindows"
  • ThresholdMinimum - This is the number at which the Counter must pass before it is logged to a text file. e.g. "1500"

** Legal **
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

2 Comments:

Anonymous Anonymous said...

I think your code has a small bug - when using PerfMon style counters your code says "oCategory.CategoryWMIName = "Win32_PerfRawData_" & oCategory.CategoryName & "_" & oCategory.CategoryName" but should read "oCategory.CategoryWMIName = "Win32_PerfRawData_" & oCategory.CategoryName & "_" & oCategory.CounterName

June 27, 2008 at 8:49 AM  
Anonymous Anonymous said...

Have you got any examples of using PerfMon style counters? I am too stupid to fugire out how to specify them......

June 27, 2008 at 9:14 AM  

Post a Comment

<< Home