Windows command line tool for disk IO monitoring

performance-countersperformance-monitoringwindowswindows-command-promptwindows-server-2003

I am looking at extracting disk IO statistics on Windows 2003 upon occurrence of some events, e.g. a long full GC occurring that is waiting a long time for CPU resource. I have read that Process Explorer allows you to do that, but it is a GUI based application, which entails that you must know when the problem will occur again and you a must already be logged into your server. However, because I do not know when it will happen, I need to write a script to output disk IO statistics when the last GC took more than x seconds.

Are there any such command line tools already available out there, such that I can simply call that program to output the results for me?

Best Answer

I am not sure about the exact type of data you are trying to collect, but all perfmon counter data is available via the typeperf command line utility even in Server 2003.

Sample use

List counters available (without instances):

typeperf -q

sample total CPU usage over 10 seconds once and return:

typeperf "Processor(_Total)\% Processor Time" -si 10 -sc 1

In general, all counters available through the perfmon GUI are also available through typeperf by the same name. Note that names may be localised on non-MUI systems.