How to check process/cpu utilisation thru unix shell scripting


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to check process/cpu utilisation thru unix shell scripting
# 1  
Old 07-25-2007
How to check process/cpu utilisation thru unix shell scripting

Dear Champs,

Can anybody help me out to write a shell script , which will check whether the process is running , if running then divide the process into 2 so that next var it can take process parallel .


Let

ps -ef | grep a.sh => shows running
note a.sh will take a process of next selected file...
if next time another but same type format file came.....it will biorcate the cpu utilisation, and allow next file to run simultaneously.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Overall cpu Utilisation

Hi, I need a command to check overall cpu utilisation TIA (3 Replies)
Discussion started by: sumanthupar
3 Replies

2. Shell Programming and Scripting

CPU utilisation in AIX

Hi, I want to write one script that sent mail when CPU utilisation is more then 70%. i used topas but problem is it will show output only when we press ctrl +c. Please let me know if there is some other command that will give cpu utilisation which i can use in shell script. Thanks (3 Replies)
Discussion started by: ranvijaidba
3 Replies

3. Solaris

CPU Utilisation for Past 1 day

Hi, Can anyone tell me how to get the CPU utilisation for past 1 day in Solaris. Below is the version i m using SunOS ss1qeb 5.10 Generic_138889-03 i86pc i386 i86pc thanks in advance (2 Replies)
Discussion started by: ali560045
2 Replies

4. UNIX for Dummies Questions & Answers

Finding cpu utilisation

Hi , I need to find the average percentage of CPU utilisised by a particular process through a shell script. Suppose if a process is running for 6 hours i need to get average CPU utilised by it. Could you please assist me. Thanks, (0 Replies)
Discussion started by: praviper
0 Replies

5. UNIX for Dummies Questions & Answers

CPU Utilisation Report on Solaris 10

Hi all, I'm using Solaris 10 and have an occasional problem where a process that runs near to midnight each day, takes anywhere between 30 seconds and over two minutes to complete. I suspect that the CPU is highly utilised during the times where it takes a long time to complete, but I need a way... (3 Replies)
Discussion started by: wthomas
3 Replies

6. AIX

CPU and memory utilisation by one process

Hi, We need to monitor one process over time to see at which exact point it starts to consume to much memory and CPU (to correlate this with some other events). I am a newbie in AIX, so please could you tell me which command will give a snapshot of the current state of a process so that I... (1 Reply)
Discussion started by: yallow
1 Replies

7. AIX

%wait nmon CPU-UTILISATION

Hi, I collect statistics with nmon. I'm very suprised about % wait of processor. Number Of Processors: 4 Processor Clock Speed: 4204 MHz Do U have an idea about % wait ? │ 0----------25-----------50----------75----------100 ... (1 Reply)
Discussion started by: tagger
1 Replies

8. Shell Programming and Scripting

Start a new process when memory/cpu utilisation falls

Hi all, I am a newbie to whole shell scripting thing. I deal with computational studies and a lot of softwares which run on linux. At times, I have to schedule my jobs after some process has started. In these case, I have to use at command to schedule my job. However, I would like to know if... (0 Replies)
Discussion started by: johnsmithgr8
0 Replies

9. UNIX for Advanced & Expert Users

How to check Process Utilisation

Hi, Is there any way in Unix to check for the system usage processwise ?? I mean I wud like to get a listing of running processes along with their CPU / memory utilisation so that I can spot dangerous the space / memory eaters .. Thanks & regards, SNS (2 Replies)
Discussion started by: Sabari Nath S
2 Replies

10. UNIX for Dummies Questions & Answers

need to know CPU utilisation

We have a Sun Sparc System which has multiple CPUs (4 Nos.). I need a command/program that can be used to monitor the % utilization per CPU. (2 Replies)
Discussion started by: saood
2 Replies
Login or Register to Ask a Question
PIDOF(8)						Linux System Administrator's Manual						  PIDOF(8)

NAME
pidof -- find the process ID of a running program. SYNOPSIS
pidof [-s] [-c] [-n] [-x] [-m] [-o omitpid[,omitpid..]] [-o omitpid[,omitpid..]..] program [program..] DESCRIPTION
Pidof finds the process id's (pids) of the named programs. It prints those id's on the standard output. This program is on some systems used in run-level change scripts, especially when the system has a System-V like rc structure. In that case these scripts are located in /etc/rc?.d, where ? is the runlevel. If the system has a start-stop-daemon (8) program that should be used instead. OPTIONS
-s Single shot - this instructs the program to only return one pid. -c Only return process ids that are running with the same root directory. This option is ignored for non-root users, as they will be unable to check the current root directory of processes they do not own. -n Avoid stat(2) system function call on all binaries which are located on network based file systems like NFS. Instead of using this option the the variable PIDOF_NETFS may be set and exported. -x Scripts too - this causes the program to also return process id's of shells running the named scripts. -o omitpid Tells pidof to omit processes with that process id. The special pid %PPID can be used to name the parent process of the pidof pro- gram, in other words the calling shell or shell script. -m When used with -o, will also omit any processes that have the same argv[0] and argv[1] as any explicitly omitted process ids. This can be used to avoid multiple shell scripts concurrently calling pidof returning each other's pids. EXIT STATUS
0 At least one program was found with the requested name. 1 No program was found with the requested name. NOTES
pidof is actually the same program as killall5; the program behaves according to the name under which it is called. When pidof is invoked with a full pathname to the program it should find the pid of, it is reasonably safe. Otherwise it is possible that it returns pids of running programs that happen to have the same name as the program you're after but are actually other programs. Note that that the executable name of running processes is calculated with readlink(2), so symbolic links to executables will also match. SEE ALSO
shutdown(8), init(8), halt(8), reboot(8), killall5(8) AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl 01 Sep 1998 PIDOF(8)