Operating System - Linux
1753649 Members
6059 Online
108798 Solutions
New Discussion юеВ

Re: how to write a script for find the maximum process running

 
Khairul_1
Frequent Advisor

how to write a script for find the maximum process running

Hi,

We have rx5670 HP-UX 11i v2 11.23 trusted cluster running system from last 4 years.

Could any one help us to wright a script for collect maximum process running in the system with threshhold. like ps -ef | grep oracle | wc -l >> /tmp/oracleprocess/process.txt

5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: how to write a script for find the maximum process running

What are you trying to measure? The number of oracle processes? Do you only want to log it if more than your threshhold number?

(I've ask this be moved to HP-UX > languages & scripting.)
Fabien GUTIERREZ
Frequent Advisor

Re: how to write a script for find the maximum process running

if you re interested in the number of processes whatever they re coming from you may use kcusage and look the nproc value
for a hourly summary
kcusage -h nproc
Venkatesh BL
Honored Contributor

Re: how to write a script for find the maximum process running

What do you mean by 'threshold'? System limit (tuning)?

Can you explain the problem in detail?
Franky_1
Respected Contributor

Re: how to write a script for find the maximum process running

Hi,

for the process with the highest amount of cpu time you can use
ps -ef|grep -v " [0-9]:"|sort -rn +7 -8

or just use "top" (/usr/bin/top)

Regards,

Franky
Don't worry be happy
James R. Ferguson
Acclaimed Contributor

Re: how to write a script for find the maximum process running

Hi:

This is but one of *four* questions of yours that begin with "How to write a script...".

What have you tried thus far? You will find better help by *defining* your requirements exactly. Showing the input and output you expect is a good start.

Regards!

...JRF...