Home All Groups Group Topic Archive Search About

Perfmon counters into SQL Server table

Author
9 May 2005 2:14 PM
John Bandettini
Hi Guys

Anyone know how to get Performance Monitor/Systems Monitor counters into a
table on SQL Server. I know you can get the SQL Server counters form
Sysperfinfo, but I want some of the non-SQL ones as well. The idea is to be
able to include it in our automated systems monitoring.

We run a mixture of systems, SQL Server 6.5 to 2000 and NT 4, Windows 2000
and 2003. I am looking to get it done on SQL 2000 running on Windows 2000 or
2003.

Thanks

John

Thanks

Author
9 May 2005 2:47 PM
Andrew J. Kelly
You might want to look at using MOM for this.  It might save you a lot of
work in the long run.

--
Andrew J. Kelly  SQL MVP


Show quote
"John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in
message news:2025FA6F-1E45-4862-8177-081094355852@microsoft.com...
> Hi Guys
>
> Anyone know how to get Performance Monitor/Systems Monitor counters into a
> table on SQL Server. I know you can get the SQL Server counters form
> Sysperfinfo, but I want some of the non-SQL ones as well. The idea is to
> be
> able to include it in our automated systems monitoring.
>
> We run a mixture of systems, SQL Server 6.5 to 2000 and NT 4, Windows 2000
> and 2003. I am looking to get it done on SQL 2000 running on Windows 2000
> or
> 2003.
>
> Thanks
>
> John
>
> Thanks
Author
10 May 2005 8:49 AM
Tibor Karaszi
Hi John!

Doesn't perfmon come with logging built-in from W2K and onwards? It is available on my XP machine,
perhaps XP was the first NT version to have "SQL Database" as option...

I know there is some stuff about this at www.sql-server-performance.com. Might be worth checking
out. As I recall it is a series of 4 articles.

Ultimately, I'd look into writing my own small app for this. I've done perfmon logging from VB6.
Perfmon API isn't fun to use (especially from VB - we had a VBX developed for us). My point here is
that I believe that .NET might very well have support for this in the framework. I know that reading
eventlog is a piece of cake in .NET. Perhaps the same goes for perfmon logging?

Watch out for accumulating counters. Sysperfinfo doesn't handle this, so you need to divide the
value with the time elapsed since last sampling (there's a KB article on this). Perfmon API *does*
handle this (if you use the right API calls). If there is support for perfmon in .NET, I suspect
that the implementation will support these types of counters properly. But do check just in case...
Show quote
"John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in message
news:2025FA6F-1E45-4862-8177-081094355852@microsoft.com...
> Hi Guys
>
> Anyone know how to get Performance Monitor/Systems Monitor counters into a
> table on SQL Server. I know you can get the SQL Server counters form
> Sysperfinfo, but I want some of the non-SQL ones as well. The idea is to be
> able to include it in our automated systems monitoring.
>
> We run a mixture of systems, SQL Server 6.5 to 2000 and NT 4, Windows 2000
> and 2003. I am looking to get it done on SQL 2000 running on Windows 2000 or
> 2003.
>
> Thanks
>
> John
>
> Thanks
Author
11 May 2005 3:32 PM
John Bandettini
Tibor

XP and windows 2003 do have options to write direct to a database table.
Unfortunately NT4 and Windows 2000 don't have the option. I can write out a
log file from NT4 and W2K but of course then I have to get that data into the
database. I was hoping someone knew an easier way to do it.

I have found several articles that talk about doing it on NT4 or W2K, but
none go into details on how.

Regards

John

Show quote
"Tibor Karaszi" wrote:

> Hi John!
>
> Doesn't perfmon come with logging built-in from W2K and onwards? It is available on my XP machine,
> perhaps XP was the first NT version to have "SQL Database" as option...
>
> I know there is some stuff about this at www.sql-server-performance.com. Might be worth checking
> out. As I recall it is a series of 4 articles.
>
> Ultimately, I'd look into writing my own small app for this. I've done perfmon logging from VB6.
> Perfmon API isn't fun to use (especially from VB - we had a VBX developed for us). My point here is
> that I believe that .NET might very well have support for this in the framework. I know that reading
> eventlog is a piece of cake in .NET. Perhaps the same goes for perfmon logging?
>
> Watch out for accumulating counters. Sysperfinfo doesn't handle this, so you need to divide the
> value with the time elapsed since last sampling (there's a KB article on this). Perfmon API *does*
> handle this (if you use the right API calls). If there is support for perfmon in .NET, I suspect
> that the implementation will support these types of counters properly. But do check just in case...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
>
> "John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in message
> news:2025FA6F-1E45-4862-8177-081094355852@microsoft.com...
> > Hi Guys
> >
> > Anyone know how to get Performance Monitor/Systems Monitor counters into a
> > table on SQL Server. I know you can get the SQL Server counters form
> > Sysperfinfo, but I want some of the non-SQL ones as well. The idea is to be
> > able to include it in our automated systems monitoring.
> >
> > We run a mixture of systems, SQL Server 6.5 to 2000 and NT 4, Windows 2000
> > and 2003. I am looking to get it done on SQL 2000 running on Windows 2000 or
> > 2003.
> >
> > Thanks
> >
> > John
> >
> > Thanks
>
>
>
Author
12 May 2005 12:53 AM
Andrew J. Kelly
You almost never want to write directly to tables for performance reasons.
You can use the Logman.exe utility to dump the log files to tables.  Check
out Logman.exe in Google.


--
Andrew J. Kelly  SQL MVP


Show quote
"John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in
message news:75827EFC-6E84-4230-A268-EE5BE79CF8CF@microsoft.com...
> Tibor
>
> XP and windows 2003 do have options to write direct to a database table.
> Unfortunately NT4 and Windows 2000 don't have the option. I can write out
> a
> log file from NT4 and W2K but of course then I have to get that data into
> the
> database. I was hoping someone knew an easier way to do it.
>
> I have found several articles that talk about doing it on NT4 or W2K, but
> none go into details on how.
>
> Regards
>
> John
>
> "Tibor Karaszi" wrote:
>
>> Hi John!
>>
>> Doesn't perfmon come with logging built-in from W2K and onwards? It is
>> available on my XP machine,
>> perhaps XP was the first NT version to have "SQL Database" as option...
>>
>> I know there is some stuff about this at www.sql-server-performance.com.
>> Might be worth checking
>> out. As I recall it is a series of 4 articles.
>>
>> Ultimately, I'd look into writing my own small app for this. I've done
>> perfmon logging from VB6.
>> Perfmon API isn't fun to use (especially from VB - we had a VBX developed
>> for us). My point here is
>> that I believe that .NET might very well have support for this in the
>> framework. I know that reading
>> eventlog is a piece of cake in .NET. Perhaps the same goes for perfmon
>> logging?
>>
>> Watch out for accumulating counters. Sysperfinfo doesn't handle this, so
>> you need to divide the
>> value with the time elapsed since last sampling (there's a KB article on
>> this). Perfmon API *does*
>> handle this (if you use the right API calls). If there is support for
>> perfmon in .NET, I suspect
>> that the implementation will support these types of counters properly.
>> But do check just in case...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>>
>> "John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in
>> message
>> news:2025FA6F-1E45-4862-8177-081094355852@microsoft.com...
>> > Hi Guys
>> >
>> > Anyone know how to get Performance Monitor/Systems Monitor counters
>> > into a
>> > table on SQL Server. I know you can get the SQL Server counters form
>> > Sysperfinfo, but I want some of the non-SQL ones as well. The idea is
>> > to be
>> > able to include it in our automated systems monitoring.
>> >
>> > We run a mixture of systems, SQL Server 6.5 to 2000 and NT 4, Windows
>> > 2000
>> > and 2003. I am looking to get it done on SQL 2000 running on Windows
>> > 2000 or
>> > 2003.
>> >
>> > Thanks
>> >
>> > John
>> >
>> > Thanks
>>
>>
>>
Author
12 May 2005 9:31 AM
John Bandettini
Andrew

I am really looking at doing this on our SQL 2000 servers. On these we have
a seperate instance that is used only by the DBA team for monitoring. The
tables would be written there, which have very little impact on the
production systems.

At the moment like a lot of sites we do some manual monitoring of the
systems using perfmon and profiler. We are just looking to automate this. I
have been a little surprised looking around the various SQL server sites not
to find an article on how to do it as I am sure someone must have.

Thanks for the tip on logman.exe I will have a look and see if it is
suitable for our purposes.

Regards

John

Show quote
"Andrew J. Kelly" wrote:

> You almost never want to write directly to tables for performance reasons.
> You can use the Logman.exe utility to dump the log files to tables.  Check
> out Logman.exe in Google.
>
>
> --
> Andrew J. Kelly  SQL MVP
>
>
> "John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in
> message news:75827EFC-6E84-4230-A268-EE5BE79CF8CF@microsoft.com...
> > Tibor
> >
> > XP and windows 2003 do have options to write direct to a database table.
> > Unfortunately NT4 and Windows 2000 don't have the option. I can write out
> > a
> > log file from NT4 and W2K but of course then I have to get that data into
> > the
> > database. I was hoping someone knew an easier way to do it.
> >
> > I have found several articles that talk about doing it on NT4 or W2K, but
> > none go into details on how.
> >
> > Regards
> >
> > John
> >
> > "Tibor Karaszi" wrote:
> >
> >> Hi John!
> >>
> >> Doesn't perfmon come with logging built-in from W2K and onwards? It is
> >> available on my XP machine,
> >> perhaps XP was the first NT version to have "SQL Database" as option...
> >>
> >> I know there is some stuff about this at www.sql-server-performance.com.
> >> Might be worth checking
> >> out. As I recall it is a series of 4 articles.
> >>
> >> Ultimately, I'd look into writing my own small app for this. I've done
> >> perfmon logging from VB6.
> >> Perfmon API isn't fun to use (especially from VB - we had a VBX developed
> >> for us). My point here is
> >> that I believe that .NET might very well have support for this in the
> >> framework. I know that reading
> >> eventlog is a piece of cake in .NET. Perhaps the same goes for perfmon
> >> logging?
> >>
> >> Watch out for accumulating counters. Sysperfinfo doesn't handle this, so
> >> you need to divide the
> >> value with the time elapsed since last sampling (there's a KB article on
> >> this). Perfmon API *does*
> >> handle this (if you use the right API calls). If there is support for
> >> perfmon in .NET, I suspect
> >> that the implementation will support these types of counters properly.
> >> But do check just in case...
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >>
> >>
> >> "John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in
> >> message
> >> news:2025FA6F-1E45-4862-8177-081094355852@microsoft.com...
> >> > Hi Guys
> >> >
> >> > Anyone know how to get Performance Monitor/Systems Monitor counters
> >> > into a
> >> > table on SQL Server. I know you can get the SQL Server counters form
> >> > Sysperfinfo, but I want some of the non-SQL ones as well. The idea is
> >> > to be
> >> > able to include it in our automated systems monitoring.
> >> >
> >> > We run a mixture of systems, SQL Server 6.5 to 2000 and NT 4, Windows
> >> > 2000
> >> > and 2003. I am looking to get it done on SQL 2000 running on Windows
> >> > 2000 or
> >> > 2003.
> >> >
> >> > Thanks
> >> >
> >> > John
> >> >
> >> > Thanks
> >>
> >>
> >>
>
>
>
Author
12 May 2005 11:05 AM
John Bandettini
Andrew

While searching for logman.exe I found an article containing all the
information I had been looking for.

In case anyone else wants to do it, here is the link.

http://www.dbazine.com/sql/sql-articles/larsen7

It does do it how Sue suggested, just fills in all the details.

Regards

John

Show quote
"John Bandettini" wrote:

> Andrew
>
> I am really looking at doing this on our SQL 2000 servers. On these we have
> a seperate instance that is used only by the DBA team for monitoring. The
> tables would be written there, which have very little impact on the
> production systems.
>
> At the moment like a lot of sites we do some manual monitoring of the
> systems using perfmon and profiler. We are just looking to automate this. I
> have been a little surprised looking around the various SQL server sites not
> to find an article on how to do it as I am sure someone must have.
>
> Thanks for the tip on logman.exe I will have a look and see if it is
> suitable for our purposes.
>
> Regards
>
> John
>
> "Andrew J. Kelly" wrote:
>
> > You almost never want to write directly to tables for performance reasons.
> > You can use the Logman.exe utility to dump the log files to tables.  Check
> > out Logman.exe in Google.
> >
> >
> > --
> > Andrew J. Kelly  SQL MVP
> >
> >
> > "John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in
> > message news:75827EFC-6E84-4230-A268-EE5BE79CF8CF@microsoft.com...
> > > Tibor
> > >
> > > XP and windows 2003 do have options to write direct to a database table.
> > > Unfortunately NT4 and Windows 2000 don't have the option. I can write out
> > > a
> > > log file from NT4 and W2K but of course then I have to get that data into
> > > the
> > > database. I was hoping someone knew an easier way to do it.
> > >
> > > I have found several articles that talk about doing it on NT4 or W2K, but
> > > none go into details on how.
> > >
> > > Regards
> > >
> > > John
> > >
> > > "Tibor Karaszi" wrote:
> > >
> > >> Hi John!
> > >>
> > >> Doesn't perfmon come with logging built-in from W2K and onwards? It is
> > >> available on my XP machine,
> > >> perhaps XP was the first NT version to have "SQL Database" as option...
> > >>
> > >> I know there is some stuff about this at www.sql-server-performance.com.
> > >> Might be worth checking
> > >> out. As I recall it is a series of 4 articles.
> > >>
> > >> Ultimately, I'd look into writing my own small app for this. I've done
> > >> perfmon logging from VB6.
> > >> Perfmon API isn't fun to use (especially from VB - we had a VBX developed
> > >> for us). My point here is
> > >> that I believe that .NET might very well have support for this in the
> > >> framework. I know that reading
> > >> eventlog is a piece of cake in .NET. Perhaps the same goes for perfmon
> > >> logging?
> > >>
> > >> Watch out for accumulating counters. Sysperfinfo doesn't handle this, so
> > >> you need to divide the
> > >> value with the time elapsed since last sampling (there's a KB article on
> > >> this). Perfmon API *does*
> > >> handle this (if you use the right API calls). If there is support for
> > >> perfmon in .NET, I suspect
> > >> that the implementation will support these types of counters properly.
> > >> But do check just in case...
> > >> --
> > >> Tibor Karaszi, SQL Server MVP
> > >> http://www.karaszi.com/sqlserver/default.asp
> > >> http://www.solidqualitylearning.com/
> > >>
> > >>
> > >> "John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in
> > >> message
> > >> news:2025FA6F-1E45-4862-8177-081094355852@microsoft.com...
> > >> > Hi Guys
> > >> >
> > >> > Anyone know how to get Performance Monitor/Systems Monitor counters
> > >> > into a
> > >> > table on SQL Server. I know you can get the SQL Server counters form
> > >> > Sysperfinfo, but I want some of the non-SQL ones as well. The idea is
> > >> > to be
> > >> > able to include it in our automated systems monitoring.
> > >> >
> > >> > We run a mixture of systems, SQL Server 6.5 to 2000 and NT 4, Windows
> > >> > 2000
> > >> > and 2003. I am looking to get it done on SQL 2000 running on Windows
> > >> > 2000 or
> > >> > 2003.
> > >> >
> > >> > Thanks
> > >> >
> > >> > John
> > >> >
> > >> > Thanks
> > >>
> > >>
> > >>
> >
> >
> >
Author
12 May 2005 2:42 AM
Sue Hoegemeier
You can just log the counters to a csv file and import the
csv file using DTS.

-Sue

On Wed, 11 May 2005 08:32:07 -0700, John Bandettini
<JohnBandett***@discussions.microsoft.com> wrote:

Show quote
>Tibor
>
>XP and windows 2003 do have options to write direct to a database table.
>Unfortunately NT4 and Windows 2000 don't have the option. I can write out a
>log file from NT4 and W2K but of course then I have to get that data into the
>database. I was hoping someone knew an easier way to do it.
>
>I have found several articles that talk about doing it on NT4 or W2K, but
>none go into details on how.
>
>Regards
>
>John
>
>"Tibor Karaszi" wrote:
>
>> Hi John!
>>
>> Doesn't perfmon come with logging built-in from W2K and onwards? It is available on my XP machine,
>> perhaps XP was the first NT version to have "SQL Database" as option...
>>
>> I know there is some stuff about this at www.sql-server-performance.com. Might be worth checking
>> out. As I recall it is a series of 4 articles.
>>
>> Ultimately, I'd look into writing my own small app for this. I've done perfmon logging from VB6.
>> Perfmon API isn't fun to use (especially from VB - we had a VBX developed for us). My point here is
>> that I believe that .NET might very well have support for this in the framework. I know that reading
>> eventlog is a piece of cake in .NET. Perhaps the same goes for perfmon logging?
>>
>> Watch out for accumulating counters. Sysperfinfo doesn't handle this, so you need to divide the
>> value with the time elapsed since last sampling (there's a KB article on this). Perfmon API *does*
>> handle this (if you use the right API calls). If there is support for perfmon in .NET, I suspect
>> that the implementation will support these types of counters properly. But do check just in case...
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>>
>> "John Bandettini" <JohnBandett***@discussions.microsoft.com> wrote in message
>> news:2025FA6F-1E45-4862-8177-081094355852@microsoft.com...
>> > Hi Guys
>> >
>> > Anyone know how to get Performance Monitor/Systems Monitor counters into a
>> > table on SQL Server. I know you can get the SQL Server counters form
>> > Sysperfinfo, but I want some of the non-SQL ones as well. The idea is to be
>> > able to include it in our automated systems monitoring.
>> >
>> > We run a mixture of systems, SQL Server 6.5 to 2000 and NT 4, Windows 2000
>> > and 2003. I am looking to get it done on SQL 2000 running on Windows 2000 or
>> > 2003.
>> >
>> > Thanks
>> >
>> > John
>> >
>> > Thanks
>>
>>
>>

AddThis Social Bookmark Button