Visit Our UNIX and Linux User Community


CPU, memory and disk stats


 
Thread Tools Search this Thread
Operating Systems Solaris CPU, memory and disk stats
# 1  
Old 05-07-2008
CPU, memory and disk stats

I've been asked to gather CPU, memory and disk stats in the following format:

Cpu_Max Cpu_Min Cpu_Avg Mem_Max Mem_Min Mem_Avg Disk_Max Disk_Min Disk_Avg


Can anyone please tell me a command to gather all this info?

Thanks!
Todd
# 2  
Old 05-07-2008
* HD: format, prtvtoc
* cpu, mem: prtdiag, psrinfo -v, iostat -En (HD-Status)
# 3  
Old 05-07-2008
What do you mean with Max, Min and Avg? These are values that implies a continuous monitoring of system resources in a certain range of time.

Once collected all the info (maybe in a logfile) you could parse the output (awk?) and produce the stats you need.

For cpu and memory usage you can have a look at vmstat command, for disks try iostat. However, maybe there's a better utility which I don't know that can do it all Smilie
# 4  
Old 05-08-2008
Use sar

Code:
NAME
     sar - system activity reporter

SYNOPSIS
     sar [-aAbcdgkmpqruvwy] [-o filename] t [n]

     sar [-aAbcdgkmpqruvwy] [-e time] [-f filename]  [-i sec]  [-
     s time]

DESCRIPTION
     In the first instance, the sar  utility  samples  cumulative
     activity  counters in the operating system at n intervals of
     t seconds, where t should be 5 or greater. If t is specified
     with  more than one option, all headers are printed together
     and the output can be difficult to read.  (If  the  sampling
     interval  is  less  than  5,  the activity of sar itself can
     affect the sample.) If the -o option is specified, it  saves
     the  samples in filename in binary format. The default value
     of n is 1.

     In the second instance, no sampling interval  is  specified.
     sar  extracts  data  from  a  previously  recorded filename,
     either the one specified by the -f option  or,  by  default,
     the    standard    system    activity    daily   data   file
     /var/adm/sa/sadd for the current day dd.  The  starting  and
     ending  times  of the report can be bounded using the -e and
     -s arguments with time specified in the  form  hh[:mm[:ss]].
     The  -i option selects records at sec second intervals. Oth-
     erwise, all intervals found in the data file are reported.

man sar for full details
Tornado
# 5  
Old 05-09-2008
Code:
mpstat - for processor
vmstat - for Virtual memory
iostat - for I/O
sar - for processor activities
top - for process wise CPU usage

# 6  
Old 05-09-2008
sar is a much better tool then vmstat and iostat for gathering performance information over time..
There's some info on sar here and here. Look at the man page aswell, its a very usefull tool once you learn how to use it.

Last edited by Tornado; 05-09-2008 at 12:09 PM..
Tornado
# 7  
Old 05-14-2008
Quote:
Originally Posted by aju_kup
Code:
mpstat - for processor
vmstat - for Virtual memory
iostat - for I/O
sar - for processor activities
top - for process wise CPU usage

If you don't have top, you can use prstat -a... About the same type of output, just without all the nice bells and whistles. Smilie

Previous Thread | Next Thread
Test Your Knowledge in Computers #784
Difficulty: Easy
The firmware for the TRS-80 Model 100 was developed by Steve Jobs.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Tool suggestion for collection CPU/memory Stats

Hi, We have around 1000 server (Red Hat + Suse + Parallels + Solaris-9/10/11). Every month, we generate a report for all servers for CPU and Memory utilization in 'percentage used'. This report is generated from HP Openview and frequency is every file minutes. In HP OpenView, we are picking 20... (0 Replies)
Discussion started by: solaris_1977
0 Replies

2. UNIX for Advanced & Expert Users

'time' for disk stats

we all know the time shell command Is there a way to test disk i/o of a process in a similar fashion? I am trying different methods to limit disk writes in a 24/7 daemon process and would like to measure. I know pidstat does it but only to a running process, i want to do one shot test... (7 Replies)
Discussion started by: bigearsbilly
7 Replies

3. Shell Programming and Scripting

Get the memory and cpu usage

what is the best way to get the memory and cpu usage of a process on any system? this is relatively simple. however, i'm looking for a unified method that would work on linux, sunos, hpux, aix. ps -ef | egrep myprocess | awk '{print $4}' ---> there could be several instances of 'myprocess'... (3 Replies)
Discussion started by: SkySmart
3 Replies

4. Shell Programming and Scripting

shell script to alert cpu memory and disk usage help please

Hi all can any one help me to script monitoring CPU load avg when reaches threshold value and disk usage if it exceeds some % tried using awk but when df -h out put is in two different lines awk doesnt work for the particular output in two different line ( output for df -h is in two... (7 Replies)
Discussion started by: robo
7 Replies

5. Solaris

Memory or CPU size

Is there a command or file I can look at that tells me how much real memory a machine has? A little background. In my shop we run a bunch of java programs, sometimes some of these jobs have config definitions that call for 2G. I would like to know how many I can run before I exhaust rescources. Any... (12 Replies)
Discussion started by: Harleyrci
12 Replies

6. UNIX for Advanced & Expert Users

vmstat's cpu stats on first line of output are always the same

Hello, I'm seeing this problem with vmstat, where the first line of output always has the same CPU statistics. For example: neked@nekedmachine:~$ date && vmstat Fri Jul 24 06:57:08 EDT 2009 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd ... (0 Replies)
Discussion started by: neked
0 Replies

7. UNIX for Dummies Questions & Answers

snmptrapd uses all the CPU and 4 Go memory

Hello all, Below what I saw on my solaris 10 box : $ prstat PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP 683 root 4082M 91M run 10 0 41:45:39 96% snmptrapd/1 syslog gives a lot of : snmptrapd: illegal data attempted to be added to table nlmLogVariableTable... (0 Replies)
Discussion started by: Gino_75
0 Replies

8. UNIX for Dummies Questions & Answers

CPU/Memory utilization

hi guys I just want to know how to get the cpu/memory utilization of a running script? Well i know that I can use the sar command but it shows the whole system's statistics. Is it possible to get the stats of a single scirpt or a single running service? (6 Replies)
Discussion started by: khestoi
6 Replies

9. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

10. UNIX for Dummies Questions & Answers

cpu, memory and virtual memory usage

Hi All, Does anyone know what the best commands in the UNIX command line are for obtaining this info: current CPU usage memory usage virtual memory usage preferably with date and time parameters too? thanks ocelot (4 Replies)
Discussion started by: ocelot
4 Replies

Featured Tech Videos