Advertisement

02.22.2007 at 11:00AM PST, ID: 22407185
[x]
Attachment Details

System monitoring using WMI

Asked by momsoft2 in Delphi Programming Language

Tags: wmi, using

Hi,

I have been trying to implement a simple system monitor application using WMI from information gathered here and elsewhere on the Internet but I am not being able to make it work. The parameters I'd like to monitor are: CPU Usage, Free Physical Memory and Network usage (upload and donwload BPS).

Upon some research I think that I have determined all properties and classes needed.

CPU Usage
Class: Win32_PerfFormattedData_PerfOS_Processor
Property: PercentProcessorTime
Instance: _Total (if there are more than one processor) else only instance.

Free Physical Memory
Class: Win32_PerfFormattedData_PerfOs_Memory
Property: AvailableBytes
Instance: Only one instance

Network Usage
Class: Win32_PerfFormattedData_Tcpip_
Property: BytesReceivedPerSec and BytesSentPerSec
Instance: I suppose the sensible thing to do is to add-up all the values from existing instances
(I am not sure if I should also take into account a possible RAS connection or not)

Maybe I could use the PerfRawData alternatives, I am not sure. I would need the application to work, at least, in the following OS: 2000,2003, XP and Vista.

It might be that the application should get the appropriate permissions on Vista (and maybe Win2003) to get access to some of the above classes. Or that I have to somehow refresh the values. Also I would like, for obvious reasons to make the code as effective as possible since it will be running constantly, gathering information once per second.

Start Free Trial
[+][-]03.12.2007 at 09:02AM PDT, ID: 18703075

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.12.2007 at 12:44PM PDT, ID: 18705150

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.12.2007 at 01:03PM PDT, ID: 18705294

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Delphi Programming Language
Tags: wmi, using
Sign Up Now!
Solution Provided By: JDuncan
Participating Experts: 1
Solution Grade: B
 
 
[+][-]03.13.2007 at 02:27PM PDT, ID: 18714093

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32