Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

get cpu usage of a process via command line

391 views
Skip to first unread message

Martin Kleucker

unread,
Aug 21, 2001, 9:50:37 AM8/21/01
to
Hi, folks,

does anybody know abot a way to get the cpu load for a specific process?
I need to react within a batch file if the cpu load is above a specific
level!

Thanks,

Martin


Martin Kleucker

unread,
Aug 22, 2001, 2:58:57 AM8/22/01
to
... or maybe just the overall cpu load?

Thx, again,
Martin

"Martin Kleucker" <martin....@esg-gmbh.de> schrieb im Newsbeitrag
news:9ltovd$be42e$1...@ID-37200.news.dfncis.de...

Phil Robyn

unread,
Aug 22, 2001, 3:09:55 AM8/22/01
to
Martin Kleucker wrote:

Why don't you check out what's available at http://www.sysinternals.com/ntw2k/utilities.shtml
especially PSTOOLS, which contains PSLIST. Sample info:

c:\cmd>pslist /?

PsList v1.12 - Process Information Lister
Copyright (C) 1999-2000 Mark Russinovich
Systems Internals - http://www.sysinternals.com

Usage: pslist [-t] [-m] [-x] [\\computer [-u username] [-p password] [name|pid]
-t Show threads
-m Show memory detail
-x Show processes, memory information and threads
\\computer Specifies remote computer
-u Optional user name for remote login
-p Optional password for remote login. If you don't present
on the command line pslist will prompt you for it if necessary.
name Show information about specified process
pid Show information about specified process

All memory values are displayed in KB.
Abbreviation key:
Pri Priority
Thd Number of Threads
Hnd Number of Handles
Mem Working Set
VM Virtual Memory
WS Working Set
WS Pk Working Set Peak
Priv Private Memory
Faults Page Faults
NonP Non-Paged Pool
Page Paged Pool
PageFile Pagefile usage
Cswtch Context Switches


c:\cmd>pslist -x zonealarm

PsList v1.12 - Process Information Lister
Copyright (C) 1999-2000 Mark Russinovich
Systems Internals - http://www.sysinternals.com

Process and thread information for C1793672-B:

Name Pid Pri Thd Hnd Mem User Time Kernel Time Elapsed Time
zonealarm 230 8 14 129 2120 0:00:00.490 0:00:14.380 4:01:28.122
VM WS WS Pk Priv Faults NonP Page PageFile
41736 2120 5072 2980 1977 6 23 2980
Tid Pri Cswtch State User Time Kernel Time Elapsed Time
43 14 595892 Ready 0:00:00.440 0:00:14.370 4:01:28.122
114 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.842
236 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.842
174 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.792
208 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.792
116 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.792
72 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.792
237 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.792
239 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.792
240 8 1 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.782
241 8 21739 Wait:UserReq 0:00:00.000 0:00:00.000 4:01:27.391
243 14 44 Wait:Executive 0:00:00.000 0:00:00.000 4:01:26.911
244 14 7083 Wait:Executive 0:00:00.000 0:00:00.010 4:01:26.911
245 14 1252 Wait:Executive 0:00:00.030 0:00:00.000 4:01:26.901

--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l


Martin Kleucker

unread,
Aug 22, 2001, 3:54:48 AM8/22/01
to
Hi, Phil

thanks, but I've tried pslist already and ... failed :-(
I can't find the cpu load in the output of pslist.
Can you tell me wich parameter reflects this?
Regards,
Martin
"Phil Robyn" <pro...@zipuclink.berkeley.edu> schrieb im Newsbeitrag
news:3B835AC2...@zipuclink.berkeley.edu...

Phil Robyn

unread,
Aug 22, 2001, 3:59:49 AM8/22/01
to
Martin Kleucker wrote:

> Hi, Phil
>
> thanks, but I've tried pslist already and ... failed :-(
> I can't find the cpu load in the output of pslist.
> Can you tell me wich parameter reflects this?
> Regards,
> Martin

What exactly do you mean by 'CPU load'?

Martin Kleucker

unread,
Aug 22, 2001, 4:08:40 AM8/22/01
to
Hi,
to see what I mean start Taskmanager, click on the "Processes"-tab, and look
at the column, called "CPU". The busier a process is, the bigger is that
number.

Martin

"Phil Robyn" <pro...@zipuclink.berkeley.edu> schrieb im Newsbeitrag

news:3B836674...@zipuclink.berkeley.edu...

Martin Kleucker

unread,
Aug 22, 2001, 4:15:18 AM8/22/01
to
... you can call it CPU usage, too (you will find it at the lower end of the
taskmanager window)
This value is displayed, too, if you're "parking" your mouse pointer of the
taskmanager icon in systray.

Regards,
Martin
"Martin Kleucker" <i...@bins.de> schrieb im Newsbeitrag
news:9lvpa8$b8ek5$1...@ID-37200.news.dfncis.de...

0 new messages