tim laqua dot com Thoughts and Code from Tim Laqua

26Nov/0811

Monitoring, Starting, and Stopping Perfmon Performance Counter Logs using VBScript

Performance counters are great - unless they're not running. 😉 So this script illustrates one approach to monitoring the Performance Counter Logs on a given machine, starting them when they stop (for whatever reason) and letting someone know about it.

UPDATE For 2008+ Data Collector Sets: Monitoring and Starting Data Collector Sets with Powershell

I check the registry to determine the current state of a counter log, and use the logman command line utility to start the log when needed. Logman can also tell you the state of the counters, but it's crazy slow. I've been unable to locate a way to do all of this using WMI and the interweb has been less helpful than usual on this issue. So here's my solution: