Questions tagged [sar]

The sar command writes to standard output the contents of selected cumulative activity counters in the operating system

Usage:

sar [ -A ] [ -b ] [ -B ] [ -C ] [ -d ] [ -h ] [ -i interval ] [ -m ] [ -p ] [ -q ] [ -r ] [ -R ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -v ] [ -V ] [ -w ] [ -W ] [ -y ] [ -n { keyword [,...] | ALL } ] [ -I { int [,...] | SUM | ALL | XALL } ] [ -P { cpu [,...] | ALL } ] [ -o [ filename ] | -f [ filename ] ] [ -s [ hh:mm:ss ] ] [ -e [ hh:mm:ss ] ] [ interval [ count ] ]

Description:

The sar command writes to standard output the contents of selected cumulative activity counters in the operating system. The accounting system, based on the values in the count and interval parameters, writes information the specified number of times spaced at the specified intervals in seconds. If the interval parameter is set to zero, the sar command displays the average statistics for the time since the system was started. If the interval parameter is specified without the count parameter, then reports are generated continuously. The collected data can also be saved in the file specified by the -o filename flag, in addition to being displayed onto the screen. If filename is omitted, sar uses the standard system activity daily data file, the /var/log/sa/sadd file, where the dd parameter indicates the current day. By default all the data available from the kernel are saved in the data file.

The sar command extracts and writes to standard output records previously saved in a file. This file can be either the one specified by the -f flag or, by default, the standard system activity daily data file.

Without the -P flag, the sar command reports system-wide (global among all processors) statistics, which are calculated as averages for values expressed as percentages, and as sums otherwise. If the -P flag is given, the sar command reports activity which relates to the specified processor or processors. If -P ALL is given, the sar command reports statistics for each individual processor and global statistics among all processors.

You can select information about specific system activities using flags. Not specifying any flags selects only CPU activity. Specifying the -A flag is equivalent to specifying -bBdqrRSvwWy -I SUM -I XALL -n ALL -u ALL -P ALL.

The default version of the sar command (CPU utilization report) might be one of the first facilities the user runs to begin system activity investigation, because it monitors major system resources. If CPU utilization is near 100 percent (user + nice + system), the workload sampled is CPU-bound.

If multiple samples and multiple reports are desired, it is convenient to specify an output file for the sar command. Run the sar command as a background process. The syntax for this is:

sar -o datafile interval count >/dev/null 2>&1 &

All data is captured in binary form and saved to a file (datafile). The data can then be selectively displayed with the sar command using the -f option. Set the interval and count parameters to select count records at interval second intervals. If the count parameter is not set, all the records saved in the file will be selected. Collection of data in this manner is useful to characterize system usage over a period of time and determine peak usage hours.

Note: The sar command only reports on local activities.

96 questions
3
votes
1 answer

How do I get sar to show for specific dates?

I am trying to display sar (CPU metrics) metrics between specific dates and I don't know exactly how it should be done. any help would be great thanks!
ErezN
  • 669
  • 2
  • 13
  • 25
3
votes
2 answers

How to generate JBoss jboss-deployment-structure from maven dependencies

We have project are built using maven. There are a lot of dependencies that is successfully resolved by good designed pom files. We need to generate sar module that we are planning to deploy on JBoss7AS. We have to describe all dependencies…
Dmitrii Borovoi
  • 2,814
  • 9
  • 32
  • 50
3
votes
1 answer

Plot multiple lists in one graph using R

I just started using R, so please be lentient... Currently I am trying to visualize some disk preformance data gathered by SAR on a Linux server. The header of the CSV data looks like this: timestamp; DEV; tps; rd_sec/s; wr_sec/s; avgrq-sz;…
sontags
  • 3,001
  • 3
  • 19
  • 25
2
votes
0 answers

JBoss sar application start service method not called on startup

I am attempting to run a JBoss service archive (sar) that was originally running on JBoss 4.2.3.GA to now run on JBoss 6.1.0.Final. I am finding that on the JBoss 6.1.0 startup, the sar's createService method is being called, but not the…
Kevin
  • 21
  • 1
2
votes
1 answer

jboss SAR instead of /tomcat/shared (alfresco for example)

Hey all, I'm curious if you can use a jboss SAR to hold all the xml, class files, and even lib files that, if you were using tomcat, were traditionally in the /shared/classes, shared/lib locations into a SAR. The intent is that instead of messing…
dhartford
  • 1,125
  • 2
  • 12
  • 35
2
votes
2 answers

how to query sar(sysstat) for more than one day data points

I don't see 'sar' command accepts date-and-time as starttime(-s) or endtime(-e) than just time. So, how to query 'sar' for more than one day's data points by passing older datetime values(-f not going to help here). The output of the 'sar' command…
Murali Mopuru
  • 6,086
  • 5
  • 33
  • 51
2
votes
1 answer

How to integrate smartGWT(presentation layer) with Spring service?

I have implemented service layer which interacts with Data Access layer for data. So basically business logic is implemented at service layer. Services are implemented on spring framework. So basically each service can run on JBoss independently(as…
Maddy.Shik
  • 6,609
  • 18
  • 69
  • 98
2
votes
3 answers

CPU monitoring script not triggering properly

I was wondering if anyone could help with the reasons that this is not triggering properly HOSTNAME=`hostname -s` LOAD=25.00 CAT=/bin/cat MAILFILE=/home/jboss/monitor.mail MAILER=/bin/mail mailto="bob@bob.bob" CPU_LOAD=`sar -P ALL 1 10 |grep…
2
votes
2 answers

Can sar display date and time?

On centos, can sar command display both date and time? I found sar can only display time as : 17:42:40 CPU %user %nice %system %iowait %steal %idle 17:42:42 all 0.31 0.00 0.69 0.06 0.00 …
Ke Lu
  • 129
  • 3
  • 16
2
votes
2 answers

How to get second-level output from sar when used with -f option?

sar man page says that one can specify the resolution in seconds for its output. However, I am not able to get a second level resolution by the following command. sar -i 1 -f /var/log/sa/sa18 11:00:01 AM CPU %user %nice %system …
user2250246
  • 3,807
  • 5
  • 43
  • 71
2
votes
1 answer

gradle: how to assemble a JBoss sar file

Is there a gradle plugin that allows me to assemble a JBoss sar file including its jboss-service.xml deployment descriptor file? Thanks for any tips on how best to do this.
Farrukh Najmi
  • 5,055
  • 3
  • 35
  • 54
2
votes
1 answer

Grabbing monthly data from SAR and showing clean results

Im trying to write something in bash to show the data logged by sar for the month. What I have so far is for file in /var/log/sa/sa??; do sar -q -f "$file" | grep "^.\{35\}1[1-9][0-9]"; done This shows the data that I want in that it shows any…
Cameron L
  • 128
  • 6
2
votes
2 answers

How is run queue length computed in linux proc filesystem

I'm trying to obtain number of runnable processes from linux kernel. sar -q gives this information readily. However I'm trying to get this value from /proc filesystem. There is no file in /proc that gives this value directly, then how is runq-sz…
marc
  • 949
  • 14
  • 33
2
votes
1 answer

unable to deploy POJO from sar in JBoss 6.1

I try to deploy and start really simple pojo in JBoss 6.1 via SAR. My jboss-service.xml looks like: bw:name=testBean
Konstantin Pribluda
  • 12,329
  • 1
  • 30
  • 35
1
vote
0 answers

How to Interpret I/O on ksar, sar

Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util sda 0.01 1.38 0.02 0.51 0.37 7.56 29.42 0.02 31.72 6.15 0.33 sda1 0.00 0.00 0.00 0.00…
flyclassic
  • 2,459
  • 6
  • 30
  • 44