Operating System - HP-UX
1752271 Members
4505 Online
108786 Solutions
New Discussion юеВ

Re: CPU and Memory utilization on HP-UX

 
SOLVED
Go to solution
bullz
Super Advisor

CPU and Memory utilization on HP-UX

Hello Guruz,

I trust some one of you might have already prepared the script for finding CPU and Memory utilization on HP-UX server.

o/p

CPU utilization in %
Memory utilization in %

It would be really great if some share the code with me.
6 REPLIES 6
Johnson Punniyalingam
Honored Contributor

Re: CPU and Memory utilization on HP-UX

Turgay Cavdar
Honored Contributor

Re: CPU and Memory utilization on HP-UX

Hp-ux has already give good tools to see CPU and Memory utilization; such as sar, vmstat, top and of course glance(if you have).
Steven E. Protter
Exalted Contributor
Solution

Re: CPU and Memory utilization on HP-UX

Shalom,

Based on HP provided scripts:

http://hpux.ws/system.perf.sh

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
bullz
Super Advisor

Re: CPU and Memory utilization on HP-UX

Folks, i manage to find the CPU utilization from the below command,

y=`sar -u 1 5 |awk '{print $5}' | tail -1`
x=`expr 100 - $y`

X is CPU Utilizaiton

In the same way, i just want the o/p in %
How much is the memory utilization?

CPU utilization 7%
Memory Utilization is 10%

Can we grep it from o/p of top?

plz help
bullz
Super Advisor

Re: CPU and Memory utilization on HP-UX

I got it.

top -f /tmp/top.txt
TM=`grep Memory /tmp/top.txt | awk '{print $2}' | sed 's/K//'`
FM=`grep Memory /tmp/top.txt | awk '{print $8}' | sed 's/K//'`
xyz1=`expr $TM - $FM`
abc2=`expr 100 \* $xyz1`
MU=`expr $abc2 / $TM`

echo $MU
bullz
Super Advisor

Re: CPU and Memory utilization on HP-UX

thanx