Windows Performance Monitor (Perfmon) Tip

Nov 5, 2008 / By Chris Presley

Tags: ,

Have you ever used Perfmon to collect performance statistics about a particular Windows Server? Do you hate manually picking the counters out of the list? Do you trace basically the same counters every time?

If you answered “yes” to any of these questions, here’s a tip that can save you some time. Once you’ve created and saved a trace, you can save/export it as an HTML document. When you need to trace a new server, with a few quick Find/Replaces from your favorite text editor, you can be up and tracing in minutes on the new host, without using the interface to pick and choose each of your counter objects.

Here’s how to do create a Perfmon trace template:

  1. If you already have a saved trace somewhere, open perfmon on that server, expand Performance Logs and Alerts and click on Counter Logs. If you don’t already have a saved trace, you’ll have to create one before getting started.
  2. From the Performance Logs and Alerts screen, right-click on your trace and click on Save Settings As…
  3. Save the file somewhere and give it a meaningful name. (The default location is My Documents.)
  4. Copy the file somewhere onto your machine for later use.

Congratulations. You’ve created and saved a template. It’s that easy. Now let’s say you’re ready to use it somewhere else.

  1. Open the file with your favorite text editor and have a look. You’ll notice that there are some lines that look something like this:
    PARAM NAME="Counter00001.Path" VALUE="\\SomeServerName\Memory\Available MBytes"

    Use Find/Replace to change “SomeServerName” to the name of the host you’re planning use it on.

  2. Save the file.
  3. Copy it to the host you’re planning to monitor and open Perfmon.
  4. Navigate back to “Counter Logs” and right click in the right window. You should have the New Log Settings From... Click it.
  5. Navigate to the file you just copied onto the server and click Open.
  6. You’ll be prompted for a name. Give your trace a meaningful name and click ok.

That’s it. You’ve imported your trace template. If your previous template had a schedule set up, you’ll need to edit the schedule before you can use the new trace.

If you’d like to tweak it a little bit (add this, remove that), you can now edit it through the interface. If you had a lot of counters to add and you really dislike the interface, you could edit the HTML file directly before importing it.

Enjoy.

6 Responses to “Windows Performance Monitor (Perfmon) Tip”

  • Susantha says:

    Good stuff. I was looking for this feature from sometime back. Now I found it. Thanks so much for the information.

  • chaoma says:

    This is what I’ve been looking for.

    Thanks alot!!!

  • Scott Myers says:

    Once you get the Perfmon data collected, then the hard part starts. Look at SmartMon (www.perfmonanalysis.com) to analyze the Perfmon data you collect.

  • Mike says:

    Another way to handle using the same file for multiple machines is to remove the “\\SomeServerName” from the counters altogetherin the .htm file. This just causes the machine to default to local host. Great article.

  • Amar says:

    This was a great guidance and saved me hours! Thank you so much.

  • JL says:

    Do you know if possible to in turn publish this via IIS and turn this into a web page there by turning it to a web based monitoring solution? … would be great to give developers etc a bit more real time view of some perfomance info. say of database servers that they otherwise dont have access.

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>