- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script required for tracking processes which utili...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2003 09:49 PM
тАО11-09-2003 09:49 PM
Script required for tracking processes which utilizing 98 % and above cpu resources.
I am in need to trace the processes which are utilizng above 98% of cpu resourses at any point of time . Can anyone help me out in writing a script for the same.
Thanks,
spv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2003 10:05 PM
тАО11-09-2003 10:05 PM
Re: Script required for tracking processes which utilizing 98 % and above cpu resources.
UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o args |sort -r -k 3
All you need to do is use awk to put the 3rd column into a variable and if its >98% then do whatever you want as that process is using 98% of the cpu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2003 10:20 PM
тАО11-09-2003 10:20 PM
Re: Script required for tracking processes which utilizing 98 % and above cpu resources.
Is ps -eo option working in hpux-11.i?
thks,
spv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2003 10:28 PM
тАО11-09-2003 10:28 PM
Re: Script required for tracking processes which utilizing 98 % and above cpu resources.
it is , if you set UNIX95 for the sake backward compatibility.
Hi Stefan,
have you been missing the 1 in UNIX95 or doesnt it matter, whats in there?
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2003 10:31 PM
тАО11-09-2003 10:31 PM
Re: Script required for tracking processes which utilizing 98 % and above cpu resources.
However,
ps -eo "pid ruser pcpu vsz=Kbytes" -o args|awk '$3>=98'
seems to do what you need.
Stick it in a loop and do what you want with the output...
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-09-2003 11:08 PM
тАО11-09-2003 11:08 PM
Re: Script required for tracking processes which utilizing 98 % and above cpu resources.
it works only if you set UNIX95 for example to 1.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2003 12:49 AM
тАО11-10-2003 12:49 AM
Re: Script required for tracking processes which utilizing 98 % and above cpu resources.
export UNIX95=
(UNIX95= defines the variable and sets the value to null) So the construct: UNIX95= ps ... is used to temporarily define UNIX95 (the value is unimportant) for the duration of ps and then remove it. So even though it looks strange, the POSIX shell (and ksh and bash, etc) allow definition of a variable followed by a command, all in the same command line.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-19-2003 04:33 AM
тАО11-19-2003 04:33 AM
Re: Script required for tracking processes which utilizing 98 % and above cpu resources.
is your problem solved? If so, could you please award some points to those, who could help you?
greetings,
Michael