info > sar(1)

Not found locally for sar. Try Google search

📖 NAME

sar - Collect, report, or save system activity information.

🚀 Quick Reference

Use CaseCommandDescription
📊 Monitor CPU usage every 2 seconds, 5 reportssar -u 2 5Report CPU utilization for each 2 seconds. 5 lines are displayed.
💾 Save CPU data to binary filesar -o datafile interval countSave readings in binary form; each reading is a separate record.
📂 Read saved data from filesar -f /var/log/sysstat/sa16 -r -n DEVDisplay memory and network statistics saved in daily data file.
🔍 Display all statistics from current daily data filesar -ADisplay all the statistics saved in current daily data file.
🖧 Report per-processor statisticssar -P ALLReport statistics for each individual processor and global.
🌐 Monitor network interfacessar -n DEV 1 3Report network device statistics every second, 3 times.

📋 SYNOPSIS

sar [ -A ] [ -B ] [ -b ] [ -C ] [ -D ] [ -d ] [ -F [ MOUNT ] ] [ -H ] [
-h ] [ -p ] [ -r [ ALL ] ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -V ] [ -v ] [
-W ] [ -w ] [ -y ] [ -z ] [ --dec={ 0 | 1 | 2 } ] [ --dev=dev_list ] [
--fs=fs_list ] [ --help ] [ --human ] [ --iface=iface_list ] [ --pretty
] [ --sadc ] [ -I { int_list | SUM | ALL } ] [ -P { cpu_list | ALL } ]
[ -m { keyword[,...] | ALL } ] [ -n { keyword[,...] | ALL } ] [ -q [
keyword[,...] | ALL ] ] [ -j { SID | ID | LABEL | PATH | UUID | ... } ]
[ -f [ filename ] | -o [ filename ] | -[0-9]+ ] [ -i interval ] [ -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 (see below). 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. It is also possible to enter -1, -2 etc. as an argument to sar to display data of that days ago. For example, -1 will point at the standard system activity file of yesterday.

Standard system activity daily data files are named saDD or saYYYYMMDD, where YYYY stands for the current year, MM for the current month and DD for the current day. They are the default files used by sar only when no filename has been explicitly specified. When used to write data to files (with its option -o), sar will use saYYYYMMDD if option -D has also been specified, else it will use saDD. When used to display the records previously saved in a file, sar will look for the most recent of saDD and saYYYYMMDD, and use it.

Standard system activity daily data files are located in the /var/log/sysstat directory by default. Yet it is possible to specify an alternate location for them: If a directory (instead of a plain file) is used with options -f or -o then it will be considered as the directory containing the data files.

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. Offline processors are not displayed.

You can select information about specific system activities using flags. Not specifying any flags selects only CPU activity. Specifying the -A flag selects all possible activities.

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

🔧 OPTIONS

📌 -A

This is equivalent to specifying -bBdFHSvwWy -I SUM -m ALL -n ALL -q ALL -r ALL -u ALL. This option also implies specifying -I ALL -P ALL unless these options are explicitly set on the command line.

📊 -B

Report paging statistics. The following values are displayed:

📀 -b

Report I/O and transfer rate statistics. The following values are displayed:

📝 -C

When reading data from a file, tell sar to display comments that have been inserted by sadc.

📅 -D

Use saYYYYMMDD instead of saDD as the standard system activity daily data file name. This option works only when used in conjunction with option -o to save data to file.

💾 -d

Report activity for each block device. When data are displayed, the device name is displayed as it (should) appear in /dev. sar uses data in /sys to determine the device name based on its major and minor numbers. If this name resolution fails, sar will use name mapping controlled by /etc/sysstat/sysstat.ioconf file. Persistent device names can also be printed if option -j is used (see below). Statistics for all devices are displayed unless a restricted list is specified using option --dev= (see corresponding option entry). Note that disk activity depends on sadc's options -S DISK and -S XDISK to be collected. The following values are displayed:

đŸ”ĸ --dec={ 0 | 1 | 2 }

Specify the number of decimal places to use (0 to 2, default value is 2).

đŸ’Ŋ --dev=dev_list

Specify the block devices for which statistics are to be displayed by sar. dev_list is a list of comma-separated device names.

âšī¸ -e [ hh:mm[:ss] ]

Set the ending time of the report. The default ending time is 18:00:00. Hours must be given in 24-hour format. This option can be used when data are read from or written to a file (options -f or -o).

📂 -F [ MOUNT ]

Display statistics for currently mounted filesystems. Pseudo-filesystems are ignored. At the end of the report, sar will display a summary of all those filesystems. Use of the MOUNT parameter keyword indicates that mountpoint will be reported instead of filesystem device. Statistics for all filesystems are displayed unless a restricted list is specified using option --fs= (see corresponding option entry). Note that filesystem statistics depend on sadc's option -S XDISK to be collected. The following values are displayed:

📂 -f [ filename ]

Extract records from filename (created by the -o filename flag). The default value of the filename parameter is the current standard system activity daily data file. If filename is a directory instead of a plain file then it is considered as the directory where the standard system activity daily data files are located. Option -f is exclusive of option -o.

đŸ’Ŋ --fs=fs_list

Specify the filesystems for which statistics are to be displayed by sar. fs_list is a list of comma-separated filesystem names or mountpoints.

đŸĸ -H

Report hugepages utilization statistics. The following values are displayed:

📐 -h

This option is equivalent to specifying --pretty --human.

❓ --help

Display a short help message then exit.

📏 --human

Print sizes in human readable format (e.g. 1.0k, 1.2M, etc.). The units displayed with this option supersede any other default units (e.g. kilobytes, sectors...) associated with the metrics.

⚡ -I { int_list | SUM | ALL }

Report statistics for interrupts. int_list is a list of comma-separated values or range of values (e.g., 0-16,35,400-). The SUM keyword indicates that the total number of interrupts received per second is to be displayed. The ALL keyword indicates that statistics from all interrupts, including potential APIC interrupt sources, are to be reported. Note that interrupt statistics depend on sadc's option -S INT to be collected.

âąī¸ -i interval

Select data records at seconds as close as possible to the number specified by the interval parameter.

🌐 --iface=iface_list

Specify the network interfaces for which statistics are to be displayed by sar. iface_list is a list of comma-separated interface names.

đŸˇī¸ -j { SID | ID | LABEL | PATH | UUID | ... }

Display persistent device names. Use this option in conjunction with option -d. Keywords ID, LABEL, etc. specify the type of the persistent name. These keywords are not limited, only prerequisite is that directory with required persistent names is present in /dev/disk. Keyword SID tries to get a stable identifier to use as the device name. A stable identifier won't change across reboots for the same physical device. If it exists, this identifier is normally the WWN (World Wide Name) of the device, as read from the /dev/disk/by-id directory.

⚡ -m { keyword[,...] | ALL }

Report power management statistics. Note that these statistics depend on sadc's option -S POWER to be collected.

🔋 CPU

With the CPU keyword, statistics about CPU are reported. The following value is displayed:

🌀 FAN

With the FAN keyword, statistics about fans speed are reported. The following values are displayed:

📊 FREQ

With the FREQ keyword, statistics about CPU clock frequency are reported. The following value is displayed:

🔌 IN

With the IN keyword, statistics about voltage inputs are reported. The following values are displayed:

đŸŒĄī¸ TEMP

With the TEMP keyword, statistics about devices temperature are reported. The following values are displayed:

🔌 USB

With the USB keyword, the sar command takes a snapshot of all the USB devices currently plugged into the system. At the end of the report, sar will display a summary of all those USB devices. The following values are displayed:

The ALL keyword is equivalent to specifying all the keywords above and therefore all the power management statistics are reported.

🌐 -n { keyword[,...] | ALL }

Report network statistics.

📡 DEV

With the DEV keyword, statistics from the network devices are reported. Statistics for all network interfaces are displayed unless a restricted list is specified using option --iface= (see corresponding option entry). The following values are displayed:

âš ī¸ EDEV

With the EDEV keyword, statistics on failures (errors) from the network devices are reported. Statistics for all network interfaces are displayed unless a restricted list is specified using option --iface= (see corresponding option entry). The following values are displayed:

🔌 FC

With the FC keyword, statistics about fibre channel traffic are reported. Note that fibre channel statistics depend on sadc's option -S DISK to be collected. The following values are displayed:

🌐 ICMP

With the ICMP keyword, statistics about ICMPv4 network traffic are reported. Note that ICMPv4 statistics depend on sadc's option -S SNMP to be collected. The following values are displayed (formal SNMP names between square brackets):

âš ī¸ EICMP

With the EICMP keyword, statistics about ICMPv4 error messages are reported. Note that ICMPv4 statistics depend on sadc's option -S SNMP to be collected. The following values are displayed (formal SNMP names between square brackets):

🌐 ICMP6

With the ICMP6 keyword, statistics about ICMPv6 network traffic are reported. Note that ICMPv6 statistics depend on sadc's option -S IPV6 to be collected. The following values are displayed (formal SNMP names between square brackets):

âš ī¸ EICMP6

With the EICMP6 keyword, statistics about ICMPv6 error messages are reported. Note that ICMPv6 statistics depend on sadc's option -S IPV6 to be collected. The following values are displayed (formal SNMP names between square brackets):

🌐 IP

With the IP keyword, statistics about IPv4 network traffic are reported. Note that IPv4 statistics depend on sadc's option -S SNMP to be collected. The following values are displayed (formal SNMP names between square brackets):

âš ī¸ EIP

With the EIP keyword, statistics about IPv4 network errors are reported. Note that IPv4 statistics depend on sadc's option -S SNMP to be collected. The following values are displayed (formal SNMP names between square brackets):

🌐 IP6

With the IP6 keyword, statistics about IPv6 network traffic are reported. Note that IPv6 statistics depend on sadc's option -S IPV6 to be collected. The following values are displayed (formal SNMP names between square brackets):

âš ī¸ EIP6

With the EIP6 keyword, statistics about IPv6 network errors are reported. Note that IPv6 statistics depend on sadc's option -S IPV6 to be collected. The following values are displayed (formal SNMP names between square brackets):

📁 NFS

With the NFS keyword, statistics about NFS client activity are reported. The following values are displayed:

📁 NFSD

With the NFSD keyword, statistics about NFS server activity are reported. The following values are displayed:

🔌 SOCK

With the SOCK keyword, statistics on sockets in use are reported (IPv4). The following values are displayed:

🔌 SOCK6

With the SOCK6 keyword, statistics on sockets in use are reported (IPv6). Note that IPv6 statistics depend on sadc's option -S IPV6 to be collected. The following values are displayed:

🖧 SOFT

With the SOFT keyword, statistics about software-based network processing are reported. The following values are displayed:

🌐 TCP

With the TCP keyword, statistics about TCPv4 network traffic are reported. Note that TCPv4 statistics depend on sadc's option -S SNMP to be collected. The following values are displayed (formal SNMP names between square brackets):

âš ī¸ ETCP

With the ETCP keyword, statistics about TCPv4 network errors are reported. Note that TCPv4 statistics depend on sadc's option -S SNMP to be collected. The following values are displayed (formal SNMP names between square brackets):

🌐 UDP

With the UDP keyword, statistics about UDPv4 network traffic are reported. Note that UDPv4 statistics depend on sadc's option -S SNMP to be collected. The following values are displayed (formal SNMP names between square brackets):

🌐 UDP6

With the UDP6 keyword, statistics about UDPv6 network traffic are reported. Note that UDPv6 statistics depend on sadc's option -S IPV6 to be collected. The following values are displayed (formal SNMP names between square brackets):

The ALL keyword is equivalent to specifying all the keywords above and therefore all the network activities are reported.

💾 -o [ filename ]

Save the readings in the file in binary form. Each reading is in a separate record. The default value of the filename parameter is the current standard system activity daily data file. If filename is a directory instead of a plain file then it is considered as the directory where the standard system activity daily data files are located. Option -o is exclusive of option -f. All the data available from the kernel are saved in the file (in fact, sar calls its data collector sadc with the option -S ALL. See sadc(8) manual page).

đŸ–Ĩī¸ -P { cpu_list | ALL }

Report per-processor statistics for the specified processor or processors. cpu_list is a list of comma-separated values or range of values (e.g., 0,2,4-7,12-). Note that processor 0 is the first processor, and processor all is the global average among all processors. Specifying the ALL keyword reports statistics for each individual processor, and globally for all processors. Offline processors are not displayed.

📐 -p, --pretty

Make reports easier to read by a human. This option may be especially useful when displaying e.g., network interfaces or block devices statistics.

📊 -q [ keyword[,...] | ALL ]

Report system load and pressure-stall statistics.

🖧 CPU

With the CPU keyword, CPU pressure statistics are reported. The following values are displayed:

💾 IO

With the IO keyword, I/O pressure statistics are reported. The following values are displayed:

📊 LOAD

With the LOAD keyword, queue length and load averages statistics are reported. The following values are displayed:

🧠 MEM

With the MEM keyword, memory pressure statistics are reported. The following values are displayed:

The PSI keyword is equivalent to specifying CPU, IO and MEM keywords together and therefore all the pressure-stall statistics are reported. The ALL keyword is equivalent to specifying all the keywords above and therefore all the statistics are reported.

🧠 -r [ ALL ]

Report memory utilization statistics. The ALL keyword indicates that all the memory fields should be displayed. The following values may be displayed:

💾 -S

Report swap space utilization statistics. The following values are displayed:

⏰ -s [ hh:mm[:ss] ]

Set the starting time of the data, causing the sar command to extract records time-tagged at, or following, the time specified. The default starting time is 08:00:00. Hours must be given in 24-hour format. This option can be used only when data are read from a file (option -f).

🔧 --sadc

Indicate which data collector is called by sar. If the data collector is sought in PATH then enter "which sadc" to know where it is located.

🕐 -t

When reading data from a daily data file, indicate that sar should display the timestamps in the original local time of the data file creator. Without this option, the sar command displays the timestamps in the user's locale time.

đŸ–Ĩī¸ -u [ ALL ]

Report CPU utilization. The ALL keyword indicates that all the CPU fields should be displayed. The report may show the following fields:

â„šī¸ -V

Print version number then exit.

📁 -v

Report status of inode, file and other kernel tables. The following values are displayed:

💾 -W

Report swapping statistics. The following values are displayed:

🔄 -w

Report task creation and system switching activity. The following values are displayed:

🖧 -y

Report TTY devices activity. The following values are displayed:

🔇 -z

Tell sar to omit output for any devices for which there was no activity during the sample period.

🌍 ENVIRONMENT

The sar command takes into account the following environment variables:

S_COLORS

By default statistics are displayed in color when the output is connected to a terminal. Use this variable to change the settings. Possible values for this variable are never, always or auto (the latter is equivalent to the default settings). Please note that the color (being red, yellow, or some other color) used to display a value is not indicative of any kind of issue simply because of the color. It only indicates different ranges of values.

S_COLORS_SGR

Specify the colors and other attributes used to display statistics on the terminal. Its value is a colon-separated list of capabilities that defaults to C=33;22:H=31;1:I=32;22:M=35;1:N=34;1:R=31;22:Z=34;22. Supported capabilities are:

S_TIME_DEF_TIME

If this variable exists and its value is UTC then sar will save its data in UTC time (data will still be displayed in local time). sar will also use UTC time instead of local time to determine the current daily data file located in the /var/log/sysstat directory. This variable may be useful for servers with users located across several timezones.

S_TIME_FORMAT

If this variable exists and its value is ISO then the current locale will be ignored when printing the date in the report header. The sar command will use the ISO 8601 format (YYYY-MM-DD) instead. The timestamp will also be compliant with ISO 8601 format.

💡 EXAMPLES

sar -u 2 5

Report CPU utilization for each 2 seconds. 5 lines are displayed.

sar -I 14 -o int14.file 2 10

Report statistics on IRQ 14 for each 2 seconds. 10 lines are displayed. Data are stored in a file called int14.file.

sar -r -n DEV -f /var/log/sysstat/sa16

Display memory and network statistics saved in daily data file sa16.

sar -A

Display all the statistics saved in current daily data file.

🐛 BUGS

/proc filesystem must be mounted for the sar command to work.

All the statistics are not necessarily available, depending on the kernel version used. sar assumes that you are using at least a 2.6 kernel.

Although sar speaks of kilobytes (kB), megabytes (MB)..., it actually uses kibibytes (kiB), mebibytes (MiB)... A kibibyte is equal to 1024 bytes, and a mebibyte is equal to 1024 kibibytes.

📁 FILES

/var/log/sysstat/saDD
/var/log/sysstat/saYYYYMMDD
The standard system activity daily data files and their default location. YYYY stands for the current year, MM for the current month and DD for the current day.

/proc and /sys contain various files with system statistics.

👤 AUTHOR

Sebastien Godard (sysstat <at> orange.fr)

🔗 SEE ALSO

sadc(8), sa1(8), sa2(8), sadf(1), sysstat(5), pidstat(1), mpstat(1), iostat(1), vmstat(8)

https://github.com/sysstat/sysstat
http://pagesperso-orange.fr/sebastien.godard/

Linux AUGUST 2020 SAR(1)

sar(1)
📖 NAME 🚀 Quick Reference 📋 SYNOPSIS 📝 DESCRIPTION 🔧 OPTIONS
📌 -A 📊 -B 📀 -b 📝 -C 📅 -D 💾 -d đŸ”ĸ --dec={ 0 | 1 | 2 } đŸ’Ŋ --dev=dev_list âšī¸ -e [ hh:mm[:ss] ] 📂 -F [ MOUNT ] 📂 -f [ filename ] đŸ’Ŋ --fs=fs_list đŸĸ -H 📐 -h ❓ --help 📏 --human ⚡ -I { int_list | SUM | ALL } âąī¸ -i interval 🌐 --iface=iface_list đŸˇī¸ -j { SID | ID | LABEL | PATH | UUID | ... } ⚡ -m { keyword[,...] | ALL } 🌐 -n { keyword[,...] | ALL } 💾 -o [ filename ] đŸ–Ĩī¸ -P { cpu_list | ALL } 📐 -p, --pretty 📊 -q [ keyword[,...] | ALL ] 🧠 -r [ ALL ] 💾 -S ⏰ -s [ hh:mm[:ss] ] 🔧 --sadc 🕐 -t đŸ–Ĩī¸ -u [ ALL ] â„šī¸ -V 📁 -v 💾 -W 🔄 -w 🖧 -y 🔇 -z
🌍 ENVIRONMENT
S_COLORS S_COLORS_SGR S_TIME_DEF_TIME S_TIME_FORMAT
💡 EXAMPLES 🐛 BUGS 📁 FILES 👤 AUTHOR 🔗 SEE ALSO

Generated by phpman v4.10.0-7-g98e9fd5 Author: Che Dong Under GNU General Public License
2026-09-10 21:51 @2600:1f28:365:80b0:2634:f534:c836:dc5e
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!