cciesliga
asked on
VB script to show/log processor utilization by process.
Greetings all,
I am looking to get a script that will report back processor utilization per process. It would also be ideal if I can run the script from a remote machine instead of the actual machine I want to report against.
I'd like something like this as the output that would be sent and appended into a log file:
Date/Time, Computer Name: x-server, Total CPU Usage: ##%
current CPU usage, Process Name
Sample:
6/20/2005 10:30:00AM, X-Server, 3%
02, explorer.exe
01, firefox.exe
00, notepad.exe
6/20/2005 10:35:00AM, X-Server, 5%
03, explorer.exe
02, firefox.exe
00, notepad.exe
If any more information is needed, please let me know.
Thanks in advance!
chris.
I am looking to get a script that will report back processor utilization per process. It would also be ideal if I can run the script from a remote machine instead of the actual machine I want to report against.
I'd like something like this as the output that would be sent and appended into a log file:
Date/Time, Computer Name: x-server, Total CPU Usage: ##%
current CPU usage, Process Name
Sample:
6/20/2005 10:30:00AM, X-Server, 3%
02, explorer.exe
01, firefox.exe
00, notepad.exe
6/20/2005 10:35:00AM, X-Server, 5%
03, explorer.exe
02, firefox.exe
00, notepad.exe
If any more information is needed, please let me know.
Thanks in advance!
chris.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hmm, it appears that I misunderstood the description of "Percent Processor Time". You're right, it isn't a snapshot of current CPU % utilisation by that process. Unfortunately I don't know how to get it then. A few newsgroups I read through indicated that it isn't easy, but none of them had a solution. Sorry.
Anyone else got any ideas?
Anyone else got any ideas?
ASKER
So, it's looking like current CPU% by process isn't going to happen. sj_hicks, thanks for the link with the variables! That will help with some other things we're trying to do.
ASKER
One other question...
What exactly is Percent Processor Time supposed to be returning? On my test box, I've got quite a few of the processes that are showing 0. Then, I have some that are showing 100 (explorer), 1 (inetinfo), 100 (notepad), etc. How is this supposed to translate into CPU Usage as would be reported in Task Manager?
Thanks again!