1836581 Members
1684 Online
110102 Solutions
New Discussion

Performance Monitoring

 
SEA RC
Occasional Contributor

Performance Monitoring

Hi

I would appreciate if someone can provide me a script which can summarise the CPU & memory utilization, disk I/O w/c shld be taken on an hourly basis. From the o/p I wld like to generate an Excel spreadsheet where I would generate a chart.

Mike,
Maybe u can help me on this. I read that u have a script doing this.

rgds

Zainal
5 REPLIES 5
someone_4
Honored Contributor

Re: Performance Monitoring

Michael Tully
Honored Contributor

Re: Performance Monitoring

Hi,

If you wish to use something that is free,
you should probably look at 'sar'

For something simple you can try this for
'CPU' output.

#------------------------
# Start System Activitiy report package
/usr/lib/sa/sa2 -s1:00 -e24:00

#------------------------
# Report CPU utilization
# collect activity every 5 minutes (300 seconds)
#------------------------
#
sar -u 300 228 >> /tech/log/cpu.out

diskio

#------------------------
# Start System Activitiy report package
/usr/lib/sa/sa2 -s4:00 -e24:00


#------------------------
# Report DISK utilization
# collect activity every 5 minutes (300 seconds)
# for 19 hours (228 times)
#------------------------
#
sar -d 300 228 >> /tech/log/io.out

Substitute the numbers on how you wish to keep
the information.

For memory and use 'vmstat'. I don't have a script but the man page gives some gives some good information.

# vmstat -n 5 2

Or alternatively (my choice) would be to purchase Glance and Measureare which contains an on-line analyser and an agent which collects information into datafiles. In turn there are other commands that will extract this information from these data files into various formats including that of spreadsheets.

HTH
-Michael
Anyone for a Mutiny ?
Clay Porter
Occasional Contributor

Re: Performance Monitoring

You could write a simple script using "top".
Here is an example:

#!/usr/bin/sh
$LOG=top.log
$TMP=top.tmp
while [ 1 ]
do
#Get one page from top
top -d 1 -f $TMP
# or you could use
# top -d 1 -n 100 -f $TMP
# -n 100 will get 100 lines from top into $TMP
echo `date` >> $LOG
cat $TMP >> LOG
rm $TMP
echo "Sleeping for 60 minutes"
# sleep for 60 minutes.
sleep 3600
done
Troyan Krastev
Regular Advisor

Re: Performance Monitoring

Hi,

This is a script for converting sar data to comma separedev value format - for Exel.

Troy.
Sanjay_6
Honored Contributor

Re: Performance Monitoring

Hi,

Have a look at another performance related question. you may get what you are looking for over there.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x1e77abe92dabd5118ff10090279cd0f9,00.html

If you don't find the solution you are looking for, just search the database. I'm sure you'll come across so many questions on the performance issue alone.

hope this helps.

thanks