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
0
votes
2 answers

Creating SAR file with Ant

I am reworking a build, and notice that the ear file contains a Service archive file (sar). I'd like to build the sar file in Ant. I suspect I could probably use the ear or zip task to do this, and simply name the file as *.sar. However, I want to…
David W.
  • 105,218
  • 39
  • 216
  • 337
0
votes
1 answer

Maven SAR packaging: how to change package structure?

I've been trying to get Maven to package up a SAR and have been using the maven jboss packaging plugin with the jboss-sar packaging type. By default, the plugin seems to package the class directory (from src/main/java) into the root of the SAR…
Rhys
  • 1,439
  • 1
  • 11
  • 23
-1
votes
1 answer

IA-32 - Working with `sarl`

I'm working on interpreting some IA-32 assembly code. This is what it reads: .data .align 4 A: .long 10, 40, 20, 50, 30 .text main: movl $0x75, %eax sarl $3, %eax I know that it's an arithmatic right shift, but I couldn't find…
donut juice
  • 257
  • 6
  • 19
-1
votes
1 answer

Class not found in JBoss

I have a jboss service. I try to load a class from different jar file, it always gives in BEA jdk1.5. It works fine sun jdk1.6. Any clue? I have a archive in abcd.sar which calls a Schedulable class from xyz.jar. So far fine. When I try instantiate…
fastcodejava
  • 39,895
  • 28
  • 133
  • 186
-1
votes
1 answer

Parsing the last entry of a sar output text file to a new text file

I'm hoping to be able to collect system CPU information using sar and want to have one file where it contains all the data collected and a second file which only stores the last entry. Output below would be my measurements.txt file 14:54:45 …
Mark O'Sullivan
  • 10,138
  • 6
  • 39
  • 60
-2
votes
1 answer

Regex to replace PHPbb url to HTML

I'm trying to search and replace URL's coming from a PHPbb dump into the correct HTML format. I'm using sublime text's Regex but can use another platform if you have any tips. Example source [url=https://example.com/example]URL Text[/url] Result…
Nils R.
  • 1
  • 3
1 2 3 4 5 6
7