Sponsored Content
Full Discussion: CPU, memory and disk stats
Operating Systems Solaris CPU, memory and disk stats Post 302192823 by Tornado on Thursday 8th of May 2008 01:44:57 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
sar(1M)                                                   System Administration Commands                                                   sar(1M)

NAME
sar, sa1, sa2, sadc - system activity report package SYNOPSIS
/usr/lib/sa/sadc [ t n] [ofile] /usr/lib/sa/sa1 [ t n] /usr/lib/sa/sa2 [-aAbcdgkmpqruvwy] [-e time] [-f filename] [-i sec] [-s time] DESCRIPTION
System activity data can be accessed at the special request of a user (see sar(1)) and automatically, on a routine basis, as described here. The operating system contains several counters that are incremented as various system actions occur. These include counters for CPU utilization, buffer usage, disk and tape I/O activity, TTY device activity, switching and system-call activity, file-access, queue activ- ity, inter-process communications, and paging. For more general system statistics, use iostat(1M), sar(1), or vmstat(1M). sadc and two shell procedures, sa1 and sa2, are used to sample, save, and process this data. sadc, the data collector, samples system data n times, with an interval of t seconds between samples, and writes in binary format to ofile or to standard output. The sampling interval t should be greater than 5 seconds; otherwise, the activity of sadc itself may affect the sam- ple. If t and n are omitted, a special record is written. This facility can be used at system boot time, when booting to a multi-user state, to mark the time at which the counters restart from zero. For example, when accounting is enabled, the svc:/sys- tem/sar:default service writes the restart mark to the daily data file using the command entry: su sys -c "/usr/lib/sa/sadc /var/adm/sa/sa'date +%d'" The shell script sa1, a variant of sadc, is used to collect and store data in the binary file /var/adm/sa/sadd, where dd is the current day. The arguments t and n cause records to be written n times at an interval of t seconds, or once if omitted. The following entries in /var/spool/cron/crontabs/sys will produce records every 20 minutes during working hours and hourly otherwise: 0 * * * 0-6 /usr/lib/sa/sa1 20,40 8-17 * * 1-5 /usr/lib/sa/sa1 See crontab(1) for details. The shell script sa2, a variant of sar, writes a daily report in the file /var/adm/sa/sardd. See the OPTIONS section in sar(1) for an explanation of the various options. The following entry in /var/spool/cron/crontabs/sys will report important activities hourly during the working day: 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A FILES
/tmp/sa.adrfl address file /var/adm/sa/sadd Daily data file /var/adm/sa/sardd Daily report file /var/spool/cron/crontabs/sys ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWaccu | +-----------------------------+-----------------------------+ SEE ALSO
crontab(1), sag(1), sar(1), svcs(1), timex(1), iostat(1M), svcadm(1M), vmstat(1M), attributes(5), smf(5) System Administration Guide: Basic Administration NOTES
The sar service is managed by the service management facility, smf(5), under the service identifier: svc:/system/sar Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). The ser- vice's status can be queried using the svcs(1) command. SunOS 5.10 20 Aug 2004 sar(1M)
All times are GMT -4. The time now is 12:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy