Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there some (free) tool that reads Performance Counters (Windows 2008 Server, but 2003 support is a bonus) and adds them to a MS SQL Server 2008 database?

Doesn't need to be too fancy as in the worst case I can add "log rotation" through triggers.

Edit: To clarify, I want to read any Performance Counter (CPU Load, Disk Queue, stuff) and merely use SQL Server as a datastore. Kinda like how the built-in CSV Logging works.

share|improve this question
You want to read it as cleartext or you just want to use it as a datastore? – Jim B Mar 26 '10 at 23:28
@Jim As a datastore - Perf Counters => SQL Server, so that I can do stuff like "SELECT AVERAGE(whatever)". Pretty much the existing Logging to CSV is fine, except I hav an app that only reads from SQL Server that would display/act on them. – Michael Stum Mar 28 '10 at 4:39

logman.exe and relog.exe, built-in tools from Windows OS. See Description of the Windows XP Logman.exe, Relog.exe, and Typeperf.exe Tools.

A short example at Relogging Perfmon binary log files to SQL

It's true that in theory you can collect the samples straight to SQL with logman, in practice is better to collect to binary and then convert them to SQL with relog.

share|improve this answer
Thanks, I'll try that out next week – Michael Stum Mar 28 '10 at 4:38

So actually you want it as cleartext. Perfmon can log directly to sql server but it creates it's own schema and tables. It might be worth while to taker al ook at the schema and develop your own views to add to it because then any counter you add will auto generate whatever calculations you want to do on the metric. The Schema can be found here. If you use relog you'll want to use this article to convert the dates/times

Here is a sample query to return min max and average grouped by 30 min. intervals:

SELECT t2.objectname, t2.countername, 
  DATEADD( minute, 
           (DATEPART(minute,CAST(SUBSTRING(t1.counterdatetime,1,23) AS DATETIME))/30)*30,
                 DATEADD(hour,DATEDIFF(hour,0,CAST(SUBSTRING(t1.counterdatetime,1,23) AS DATETIME)),0)) AS Period,
  AVG(t1.countervalue) AS [Avg], 
  MIN(t1.countervalue) AS [Min],  
  MAX(t1.countervalue) AS [Max]
FROM counterdata t1 INNER JOIN counterdetails t2 ON t2.counterid=t1.counterid
WHERE t2.countername = '% Processor Time' AND t2.instancename = '_Total'
AND t2.objectname = 'Processor'
GROUP BY DATEADD( minute, (DATEPART(minute,CAST(SUBSTRING(t1.counterdatetime,1,23) AS DATETIME))/30)*30,
                  DATEADD(hour,DATEDIFF(hour,0,CAST(SUBSTRING(t1.counterdatetime,1,23) AS DATETIME)),0)),
  t2.objectname, t2.countername
share|improve this answer

I know this is old, but I don't see any answer marked as accepted, so I'll add my two cents...

I was looking for a similar thing and came across a tool called PolyMon ( The actual performance counters are gathered by a Windows service and then stashed into SQL Server. The management UI is a kind of clunky, but it works and I've set up about 60 counters so far.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.