10

I'd like to create a settings file for my logman command. I expect to have lots of perfmon counters.

Is there any easy way to get all the perfmon counters' exact text anywhere?

The only thing I thought of was to create a Perfmon Counter Log through the GUI and then export the list of selected counters--but I don't see an export option! I guess I could manually copy what I see on the screen, but that seems inefficient. I'm going to be dealing with tens of counters.

Maybe there is a list somewhere? That'd be easier to copy and paste from.

Bill Paetzke
  • 855
  • 4
  • 12
  • 19

3 Answers3

14

An easy way to achieve this, is by using the typeperf command.

  1. For example, to get an complete list of all available Windows PerfMon counters is by typing the following command from a command prompt: typeperf -q

  2. Create a file counters.txt with all the counters you would like to monitor, (1 per line)

  3. send output to a logfile. (typeperf -cf counters.txt -si 5 -sc 50 -f TSV -o domain2.tsv)

Good luck! Henk

EightBitTony
  • 9,211
  • 1
  • 32
  • 46
  • Here's what I did: `typeperf -q -o "C:\Temp\counters.txt"`. That sent all the counter names to a text file. And then it's trivial to build a logman script. Thank you, @Henk! – Bill Paetzke Jun 14 '10 at 17:36
  • You made my day. – Jir Apr 12 '13 at 10:27
  • Microsoft documentation link, for options/switches: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/typeperf – ryanwebjackson Oct 11 '18 at 13:04
2

The only way I've ever been able to do this is to set up your trace and then save it (or copy the properties and paste them to a text file). The HTML or copied properties creates an <object> tag with a lot of <param> tags to set up the trace. It's not very pretty, but you can use an XML parser to filter the <param> tags. The counters have NAME attributes in the format Counterxxxxx (where the X's are incremental numbers with leading 0's) and a Path attribute that is the name of the target machine concantenated with the name of the counter. Filter out those specific nodes and you'll get the list.

I don't know how you would go about just exporting a list of all available counters on your system. Maybe WMI or Powershell has something you can get it from.

Also, have a look at this question which might give you some more leads.

squillman
  • 37,618
  • 10
  • 90
  • 145
2

You can export a list of all the services that have performance counters on a particular machine by querying the registry of said machine. From a command prompt type reg query /? to get a list of arguments.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171