Operating System - HP-UX
1748019 Members
4830 Online
108757 Solutions
New Discussion юеВ

Re: Script to to find CPU and memory utilization.

 
SOLVED
Go to solution
jeevarajkn
Frequent Advisor

Script to to find CPU and memory utilization.

Dear Guru's

Server-HP UX IA-11.23

Please help me to find a script to get CPU and memory usage of my server in every 1hr.

I just want to get the utilization value in every 1 Hr, no need to get the high utilization process.


Thanks in Advance!!!!

Jeevaraj Sivaraman
11 REPLIES 11
Stephan._1
Trusted Contributor

Re: Script to to find CPU and memory utilization.

Hi,
what about enabling sar?

http://docs.hp.com/en/B3921-90010/sar.1M.html
Share what you know, learn what you don't.
Michal Kapalka (mikap)
Honored Contributor

Re: Script to to find CPU and memory utilization.

hi,

you could use glance, or gpm (gui)

mikap
Vijaykumar_1
Valued Contributor

Re: Script to to find CPU and memory utilization.

hi Jeevraj,

If you have OVO monitoring installed, then you can use the following ..

$ /opt/OV/bin/ovcodautil -dumpds SCOPE | grep -i GBL_CPU_UTIL
Hakki Aydin Ucar
Honored Contributor

Re: Script to to find CPU and memory utilization.

# sar -u [interval] [iterations]
(example: sar -u 5 30)
OR

sar -Mu 5 100
(this will produce 100 data points 5 seconds apart.)

%idle This is the percentage of time that the CPU is not running processes.

%usr - user mode Many systems normally operate with 80% of the CPU time spent as user time, and 20% spent as system time.

%sys- system mode

%wio - idle with some process waiting for I/O
jeevarajkn
Frequent Advisor

Re: Script to to find CPU and memory utilization.

Dear Hakki,

Thanks. it will help me to get the CPU usage , can you help me to find out the swap memory usage , I want this on percentage like swapinfo output.

Reg
Jeevaraj Sivaraman
Prashantj
Valued Contributor
Solution

Re: Script to to find CPU and memory utilization.

Hi Jeevarajkn,

Please go thru that belwo script.

echo " *********** **************** " >> /tmp/swap.txt
echo "CUP and memory Utlization Report" >> /tmp/swap.txt
date >> /tmp/swap.txt
swapinfo -tam >> /tmp/swap.txt

Edit Crontab file with
* 1 * * * < Scrip Path >

Hope this will help you.

prashant
Good judgment comes from experience and experience comes from bad judgment.
Raj D.
Honored Contributor

Re: Script to to find CPU and memory utilization.

Jeevaraj,

Check this out : script : cpumme.sh to get cpu memory utilization over a time,

I have a latest script with swap,raw disk i/o, network usage details and ll upload soon.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1250075141947+28353475&threadId=1037077


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: Script to to find CPU and memory utilization.

Jeevaraj,

Check this out : script : cpumem.sh to get cpu memory utilization over a time,

I have a latest script with swap,raw disk i/o, network usage details and ll upload soon.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?admit=109447626+1250075141947+28353475&threadId=1037077


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Steven E. Protter
Exalted Contributor

Re: Script to to find CPU and memory utilization.

Shalom Jeevaraj,

Have you tried this:
http://www.hpux.ws/?p=6

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