07-17-2011
Hi ,
Thanks Mayur for your inputs..
I need a PID of the highest CPU consuming process.
#!/usr/bin/ksh
cpu_usage_limit=60 #In percentage
host=`hostname`
top -l 1| awk ‘/CPU usage/ {print $3, $12}’ >> $host_top_output.txt
usage=`grep "^ *$1 " $host_top_output.txt | awk '{print $2}' | sed 's/%//'`
PID=`grep "^ *$1 " $host_top_output.txt | awk '{print $1}'`
if [[ $usage -gt $cpu_usage_limit ]] then
SQL_Statement to get the SQL code of high CPU consuming process by using the above PID.
Is there any other way to grep CPU & PID using TOP command in HP-UX system?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
how can i do that in a script withough havin the script halt at the section where the top command is located. am writign a script that will send me the out put of unx commands if the load average of a machine goes beyond the recommended number.
top -n 20
i want to save this output to a file... (1 Reply)
Discussion started by: TRUEST
1 Replies
2. Solaris
I want to figure out what is the reason of error message I have in Solaris 10. Why Solaris 10 dosn't recognize 65535?
ps: 65535 is an invalid non-numeric argument for -p option
usage: ps
'format' is one or more of:
Thank you (5 Replies)
Discussion started by: gogogo
5 Replies
3. Shell Programming and Scripting
Hi all,
I am parsing command line options using getopts.
The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument.
Below is the script:
while getopts :hd:t:s:l:p:f: opt
do
case "$opt" in
-h|-\?)... (2 Replies)
Discussion started by: gurukottur
2 Replies
4. AIX
Is there a 'top' command equivalent in AIX 4.2 ?
I already checked and I do not see the following ones anywhere:
top
nmon
topas (1 Reply)
Discussion started by: Browser_ice
1 Replies
5. Shell Programming and Scripting
In the following code
a=
echo $?
echo $?
Why the op is (2 Replies)
Discussion started by: lipun4u
2 Replies
6. AIX
Okay, I am trying to come up with a multi-platform script to report top ten CPU and memory hog processes, which will be run by our enterprise monitoring application as an auto-action item when the CPU and Memory utilization gets reported as higher than a certain threshold
I use top on other... (5 Replies)
Discussion started by: thenomad
5 Replies
7. Shell Programming and Scripting
To find all the files in your home directory that have been edited in some way since the last tar file, use this command:
find . -newer backup.tar.gz
Is anyone familiar with an older solution?
looking to identify files older then 15mins across several directories.
thanks,
manny (2 Replies)
Discussion started by: mr_manny
2 Replies
8. Shell Programming and Scripting
What is the significance of the *) and ?) in the below code.
while getopts a:b:c:he opt
do
case $opt in
a) _name="$OPTARG";;
b) _project="$OPTARG";;
c) line="$OPTARG";;
e) _cmd="XX";;
h) Projects=1;;
*) echo "$OPTARG is an invalid option";
my_exit 1;;
?)... (3 Replies)
Discussion started by: posix
3 Replies
9. UNIX for Dummies Questions & Answers
The script below fails with the following error messages:
gzip: invalid option -- 'w'
Try `gzip --help' for more information.
mysqldump: Got errno 32 on write
cp: invalid option -- 'w'
Try `cp --help' for more information.
rm: invalid option -- 'w'
Try `rm --help' for more information.
... (1 Reply)
Discussion started by: ANNACTION
1 Replies
10. Solaris
Hi,
I installed some packages required by an app built with python.
But when I try python setup.py install, I get the following error:
/opt/csw/lib/gcc/sparc-sun-solaris2.10/5.2.0/../../../../sparc-sun-solaris2.10/bin/as: unrecognized option `-m32'
Could anyone tell me what's wrong... (4 Replies)
Discussion started by: Kimkun
4 Replies
LEARN ABOUT SUSE
wmsmpmon
WMSMPMON(1) General Commands Manual WMSMPMON(1)
NAME
wmSMPmon - Window Maker System Monitor
SYNOPSIS
wmSMPmon [options]
DESCRIPTION
wmSMPmon is a Window Maker dock application that displays the following information about the system:
- Current CPU utilization of up to two CPUs
- Up to two minutes history of CPU utilization
- Current memory usage
- Current swap usage
On dual CPU systems, wmSMPmon has three different styles for the utilization graph. To toggle between them just click into the graph.
OPTIONS
All options start with one dash.
-h Show summary of options.
-r REFRESH_RATE
Set the refresh rate of the graph in microseconds. The default is 250000 (a quarter of a second).
-g GRAPH_STYLE
Start using graph style #[1-3] (only on dual CPU systems). Style 1 shows the utiliziation in one graph, while 2 and 3 are split in
two little graphs. Style 2 shows the two graphs on top of each other. Style 3 uses a mirror like type. The default style is 1, which
is also the style used on single CPU systems.
-c1 IDX, -c2 IDX
On systems with more than 2 CPUs, select the CPUs to show. Per default CPU number 1 and 2 are shown. On a quad CPU systems you may
launch second wmSMPmon showing CPUs number 3 and 4.
-no-swap
Do not monitor swap.
SEE ALSO
wmaker(1x)
AUTHOR
This manual page was originally written by Alain Schroeder <alain@debian.org> and adapted for wmSMPmon 3 by Thomas Ribbrock
<emgaron@gmx.net>
WMSMPMON(1)