SAR(1)

๐Ÿ’– sar(1) ๐Ÿ’–

okay so this one's from the Linux User's Manual, section 1, and it's sar. it's a whole thing, bestie โ€” grab a snack ๐Ÿ“


โœจ NAME โœจ

sar โ€” collect, report, or save system activity information. that's the whole job. it's giving "the main character of system monitoring" ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

sar [ -A ] [ -B ] [ -b ] [ -C ] [ -D ] [ -d ] [ -F [ MOUNT ] ] [ -H ] [
-h ] [ -p ] [ -r [ ALL ] ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -V ] [ -v ] [
-W ] [ -w ] [ -x ] [ -y ] [ -z ] [ --dec={ 0 | 1 | 2 } ] [
--dev=dev_list ] [ --fs=fs_list ] [ --help ] [ --human ] [
--iface=iface_list ] [ --int=int_list ] [ --pretty ] [ --sadc ] [ -I [
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 [ start_time ] ] [ -e [ end_time ] ] ] [
interval [ count ] ]

yeah she's long. she's worth it tho ๐Ÿซถ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so the sar command writes to standard output the contents of selected cumulative activity counters in the operating system. basically it peeks at the kernel's receipts ๐Ÿ’…

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. so like โ€” you say how often, you say how many, it goes brrr.

if the interval parameter is set to zero, the sar command displays the average statistics for the time since the system was started. origin story energy โœจ and if interval is specified without count, then reports are generated continuously โ€” no cap, it just keeps going ๐Ÿ˜ญ

the collected data can also be saved in the file specified by the -o filename flag, in addition to being displayed onto the screen. and if filename is omitted, sar uses the standard system activity daily data file (details below, iykyk). by default all the data available from the kernel are saved in the data file. all of it. no crumbs.

the sar command also 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. and here's the cute part โ€” it is also possible to enter -1, -2 etc. as an argument to sar to display data of that many days ago. for example, -1 will point at the standard system activity file of yesterday ๐Ÿ•ฐ๏ธ time travel but make it sysadmin.

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. queen of always picking the freshest fit ๐Ÿ‘—

standard system activity daily data files are located in the /var/log/sa 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. flexible. we love to see it ๐Ÿ’ซ

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 โ€” if they're not on the apps, they're not in the report ๐Ÿ™ˆ

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. go big or go home honestly ๐Ÿ”ฅ

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. she's booked, she's busy, she's at capacity ๐Ÿ’€

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. it's giving "let me take notes so I can gossip about my system later" ๐Ÿ“

Note: the sar command only reports on local activities. no long-distance, bestie. this is local-only ๐Ÿ 

๐ŸŒˆ OPTIONS ๐ŸŒˆ

  • -A โ€” this is equivalent to specifying -bBdFHISvwWy -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. basically the "give me everything" button ๐Ÿฝ๏ธ
  • -B โ€” report paging statistics. the following values are displayed:
    • pgpgin/s โ€” total number of kibibytes the system paged in from disk per second.
    • pgpgout/s โ€” total number of kibibytes the system paged out to disk per second.
    • fault/s โ€” number of page faults (major + minor) made by the system per second. this is not a count of page faults that generate I/O, because some page faults can be resolved without I/O. sneakyyy ๐Ÿ‘€
    • majflt/s โ€” number of major faults the system has made per second, those which have required loading a memory page from disk.
    • pgfree/s โ€” number of pages placed on the free list by the system per second.
    • pgscank/s โ€” number of pages scanned by the kswapd daemon per second (done in background, healthy system). green flags only ๐ŸŒฟ
    • pgscand/s โ€” number of pages scanned directly per second (process is stalled). not the vibe ๐Ÿ˜ฌ
    • pgsteal/s โ€” number of pages the system has reclaimed from cache (pagecache and swapcache) per second to satisfy its memory demands.
    • pgprom/s โ€” number of pages promoted (i.e. migrated from slow to fast memory types) by the system per second. glow up โœจ
    • pgdem/s โ€” number of pages demoted (i.e. migrated from fast to slow memory types) by the system per second. it's giving flop era ๐Ÿ˜”
  • -b โ€” report I/O and transfer rate statistics. the following values are displayed:
    • tps โ€” total number of transfers per second that were issued to physical devices. a transfer is an I/O request to a physical device. multiple logical requests can be combined into a single I/O request to the device. a transfer is of indeterminate size. mysterious. love that for her ๐ŸŽ€
    • rtps โ€” total number of read requests per second issued to physical devices.
    • wtps โ€” total number of write requests per second issued to physical devices.
    • dtps โ€” total number of discard requests per second issued to physical devices.
    • bread/s โ€” total amount of data read from the devices in blocks per second. blocks are equivalent to sectors and therefore have a size of 512 bytes.
    • bwrtn/s โ€” total amount of data written to devices in blocks per second.
    • bdscd/s โ€” total amount of data discarded for devices in blocks per second.
  • -C โ€” when reading data from a file, tell sar to display comments that have been inserted by sadc. the commentary, the lore, the behind-the-scenes ๐Ÿ’ฌ
  • -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. solo it does nothing, bestie, it needs its plus-one ๐Ÿซถ
  • -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/conf.d/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:
    • tps โ€” total number of transfers per second that were issued to physical devices. a transfer is an I/O request to a physical device. multiple logical requests can be combined into a single I/O request to the device. a transfer is of indeterminate size.
    • rkB/s โ€” number of kibibytes read from the device per second.
    • wkB/s โ€” number of kibibytes written to the device per second.
    • dkB/s โ€” number of kibibytes discarded for the device per second.
    • areq-sz โ€” the average size (in kibibytes) of the I/O requests that were issued to the device.
Note: in previous versions, this field was known as avgrq-sz and was expressed in sectors. rebrand era ๐Ÿ’…
  • aqu-sz โ€” the average queue length of the requests that were issued to the device.
Note: in previous versions, this field was known as avgqu-sz. another rebrand, we stay adapting ๐Ÿฆ‹
  • await โ€” the average time (in milliseconds) for I/O requests issued to the device to be served. this includes the time spent by the requests in queue and the time spent servicing them. the whole journey, not just the destination ๐Ÿšถโ€โ™€๏ธ
  • %util โ€” percentage of elapsed time during which I/O requests were issued to the device (bandwidth utilization for the device). device saturation occurs when this value is close to 100% for devices serving requests serially. but for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not reflect their performance limits. don't @ her, she's doing her best ๐Ÿ˜ค
  • --dec={ 0 | 1 | 2 } โ€” specify the number of decimal places to use (0 to 2, default value is 2). pick your precision, pick your poison ๐Ÿ”ข
  • --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. keep it curated, keep it cute ๐ŸŽ€
  • -e [ hh:mm[:ss] ], -e [ seconds_since_the_epoch ] โ€” sets the ending time of the report, bestie. Default ending time is 18:00:00 ๐Ÿ’–. Hours go in 24-hour format, or you can hand it the number of seconds since the epoch (as a 10 digit number). This option is usable when data are read from or written to a file (options -f or -o). So likeโ€ฆ you can time-box your whole investigation, iconic.
  • -F [ MOUNT ] โ€” shows stats for currently mounted filesystems โœจ. Pseudo-filesystems get ignored, no cap. At the end of the report sar will display a summary of all those filesystems, which is giving wrap-up-slide energy ๐ŸŽ€. If you use the MOUNT parameter keyword, that means the mountpoint gets reported instead of the filesystem device. Stats for all filesystems are displayed unless you specify a restricted list using option --fs= (see the corresponding option entry, it's right below ๐Ÿ‘€). Note that filesystems statistics depend on sadc's option -S XDISK to be collected โ€” like, they literally won't be there otherwise, so don't come for sar ๐Ÿ™ˆ.

The following values are displayed:

  • MBfsfree โ€” total amount of free space in mebibytes (including space available only to privileged user).
  • MBfsused โ€” total amount of space used in mebibytes.
  • %fsused โ€” percentage of filesystem space used, as seen by a privileged user.
  • %ufsused โ€” percentage of filesystem space used, as seen by an unprivileged user.
  • Ifree โ€” total number of free file nodes in filesystem.
  • Iused โ€” total number of file nodes used in filesystem.
  • %Iused โ€” percentage of file nodes used in filesystem.
  • -f [ filename ] โ€” extracts records from filename (which was created by the -o filename flag, iykyk). The default value of the filename parameter is the current standard system activity daily data file. Plot twist: if filename is a directory instead of a plain file, then it's treated as the directory where the standard system activity daily data files are located ๐Ÿ—‚๏ธ. Heads up: option -f is exclusive of option -o โ€” they do not coexist, periodt.
  • --fs=fs_list โ€” specifies the filesystems whose statistics sar should display ๐ŸŒธ. fs_list is a list of comma-separated filesystem device names (for example /dev/sdb1) and/or mountpoints (for example /srv). Either form is accepted for filtering, independent of whether option -F is showing device names or mountpoints โ€” flexible queen behavior ๐Ÿ‘‘.
  • -H โ€” reports hugepages utilization statistics ๐Ÿ’œ. The following values are displayed:
    • kbhugfree โ€” amount of hugepages memory in kibibytes that is not yet allocated.
    • kbhugused โ€” amount of hugepages memory in kibibytes that has been allocated.
    • %hugused โ€” percentage of total hugepages memory that has been allocated.
    • kbhugrsvd โ€” amount of reserved hugepages memory in kibibytes.
    • kbhugsurp โ€” amount of surplus hugepages memory in kibibytes.
  • -h โ€” this option is equivalent to specifying --pretty --human. That's it, that's the whole vibe โœจ.
  • --help โ€” displays a short help message then exits. Cute, quick, bye ๐Ÿซถ.
  • --human โ€” prints 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. kibibytes, sectorsโ€ฆ) associated with the metrics โ€” so it overrides, it does not negotiate ๐Ÿ’….
  • -I [ SUM | ALL ] โ€” reports statistics for interrupts โšก. The values displayed are the number of interrupts per second for the given processor or among all processors. A list of interrupts can be specified using --int= (see that option). 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 are to be reported (this is the default, bestie). Note that interrupts statistics depend on sadc's option -S INT to be collected.
  • -i interval โ€” selects data records at seconds as close as possible to the number specified by the interval parameter. So it's not like, exactly exactly, it's as-close-as-possible ๐ŸŽฏ.
  • --iface=iface_list โ€” specifies the network interfaces whose statistics sar should display ๐ŸŒˆ. iface_list is a list of comma-separated interface names.
  • --int=int_list โ€” specifies the interrupts names whose statistics sar should display. int_list is a list of comma-separated values or range of values (e.g., 0-16,35,40-). Note the trailing dash โ€” that's a real thing, not a typo, she's open-ended ๐Ÿ’€.
  • -j { SID | ID | LABEL | PATH | UUID | ... } โ€” displays 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 โ€” the only prerequisite is that a directory with the 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, which is the dream, honestly. 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 } โ€” reports power management statistics ๐Ÿ”‹. Note that these statistics depend on sadc's option -S POWER to be collected.

Possible keywords are BAT, CPU, FAN, FREQ, IN, TEMP and USB.

With the BAT keyword, statistics about batteries capacity are reported. The following values are displayed:

  • %cap โ€” battery capacity.
  • cap/min โ€” capacity lost or gained per minute by the battery.
  • status โ€” charging status of the battery: โ†‘ (full), โ†— (charging), โ†’ (not charging), โ†˜ (discharging), ? (unknown). Tiny drama arrows, we love to see it ๐Ÿ˜ญ.

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

  • MHz โ€” instantaneous CPU clock frequency in MHz.

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

  • rpm โ€” fan speed expressed in revolutions per minute.
  • drpm โ€” this field is calculated as the difference between current fan speed (rpm) and its low limit (fan_min).
  • DEVICE โ€” sensor device name.

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

  • wghMHz โ€” weighted average CPU clock frequency in MHz. Note that the cpufreq-stats driver must be compiled in the kernel for this option to work โ€” no driver, no numbers, just vibes ๐ŸŒธ.

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

  • inV โ€” voltage input expressed in Volts.
  • %in โ€” relative input value. A value of 100% means that voltage input has reached its high limit (in_max) whereas a value of 0% means that it has reached its low limit (in_min).
  • DEVICE โ€” sensor device name.

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

  • degC โ€” device temperature expressed in degrees Celsius.
  • %temp โ€” relative device temperature. A value of 100% means that temperature has reached its high limit (temp_max).
  • DEVICE โ€” sensor device name.

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:

  • BUS โ€” root hub number of the USB device.
  • idvendor โ€” vendor ID number (assigned by USB organization).
  • idprod โ€” product ID number (assigned by Manufacturer).
  • maxpower โ€” maximum power consumption of the device (expressed in mA).
  • manufact โ€” manufacturer name.
  • product โ€” product name.

The ALL keyword is equivalent to specifying all the keywords above and therefore all the power management statistics are reported โ€” the full menu, no skips ๐Ÿ’….

  • -n { keyword[,...] | ALL } โ€” reports network statistics ๐ŸŒ.

Possible keywords are DEV, EDEV, FC, ICMP, EICMP, ICMP6, EICMP6, IP, EIP, IP6, EIP6, NFS, NFSD, SOCK, SOCK6, SOFT, TCP, ETCP, UDP and UDP6.

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 the corresponding option entry). The following values are displayed:

  • IFACE โ€” name of the network interface for which statistics are reported.
  • rxpck/s โ€” total number of packets received per second.
  • txpck/s โ€” total number of packets transmitted per second.
  • rxkB/s โ€” total number of kibibytes received per second.
  • txkB/s โ€” total number of kibibytes transmitted per second.
  • rxcmp/s โ€” number of compressed packets received per second (for cslip etc.).
  • txcmp/s โ€” number of compressed packets transmitted per second.
  • rxmcst/s โ€” number of multicast packets received per second.
  • %ifutil โ€” utilization percentage of the network interface. For half-duplex interfaces, utilization is calculated using the sum of rxkB/s and txkB/s as a percentage of the interface speed. For full-duplex, this is the greater of rxkB/S or txkB/s. (Yes, that capital S is exactly how it's written in the original โ€” copying it verbatim, bestie ๐Ÿค.)

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 the corresponding option entry). The following values are displayed:

  • IFACE โ€” name of the network interface for which statistics are reported.
  • rxerr/s โ€” total number of bad packets received per second.
  • txerr/s โ€” total number of errors that happened per second while transmitting packets.
  • coll/s โ€” number of collisions that happened per second while transmitting packets.
  • rxdrop/s โ€” number of received packets dropped per second because of a lack of space in linux buffers.
  • txdrop/s โ€” number of transmitted packets dropped per second because of a lack of space in linux buffers.
  • txcarr/s โ€” how many carrier-errors went down per second while we were transmitting packets ๐Ÿ’€
  • rxfram/s โ€” how many frame alignment errors happened per second on the packets we received ๐Ÿซ 
  • rxfifo/s โ€” how many FIFO overrun errors happened per second on received packets
  • txfifo/s โ€” how many FIFO overrun errors happened per second on transmitted packets

๐Ÿฆ‹ the FC keyword

okay so when you use the FC keyword, you get stats about fibre channel traffic. heads up tho: fibre channel numbers only exist if sadc was run with the -S DISK option to actually collect them. iykyk. here's what shows up:

  • FCHOST โ€” the name of the fibre channel host bus adapter (HBA) interface these stats are for ๐ŸŽ€
  • fch_rxf/s โ€” total frames received per second
  • fch_txf/s โ€” total frames transmitted per second
  • fch_rxw/s โ€” total transmission words received per second
  • fch_txw/s โ€” total transmission words transmitted per second

๐ŸŒˆ the ICMP keyword

ICMP gives you stats about ICMPv4 network traffic ๐Ÿ’– btw these depend on sadc's -S SNMP option being used to collect them, so likeโ€ฆ no collection, no data, no cap. formal SNMP names are in the square brackets, bestie:

  • imsg/s โ€” total number of ICMP messages this entity received per second [icmpInMsgs]. not me telling you this counter includes everything counted by ierr/s ๐Ÿ™ˆ
  • omsg/s โ€” total number of ICMP messages this entity tried to send per second [icmpOutMsgs]. and yeah, this one includes everything counted by oerr/s.
  • iech/s โ€” number of ICMP Echo (request) messages received per second [icmpInEchos]
  • iechr/s โ€” number of ICMP Echo Reply messages received per second [icmpInEchoReps]
  • oech/s โ€” number of ICMP Echo (request) messages sent per second [icmpOutEchos]
  • oechr/s โ€” number of ICMP Echo Reply messages sent per second [icmpOutEchoReps]
  • itm/s โ€” number of ICMP Timestamp (request) messages received per second [icmpInTimestamps]
  • itmr/s โ€” number of ICMP Timestamp Reply messages received per second [icmpInTimestampReps]
  • otm/s โ€” number of ICMP Timestamp (request) messages sent per second [icmpOutTimestamps]
  • otmr/s โ€” number of ICMP Timestamp Reply messages sent per second [icmpOutTimestampReps]
  • iadrmk/s โ€” number of ICMP Address Mask Request messages received per second [icmpInAddrMasks]
  • iadrmkr/s โ€” number of ICMP Address Mask Reply messages received per second [icmpInAddrMaskReps]
  • oadrmk/s โ€” number of ICMP Address Mask Request messages sent per second [icmpOutAddrMasks]
  • oadrmkr/s โ€” number of ICMP Address Mask Reply messages sent per second [icmpOutAddrMaskReps]

๐Ÿ’… the EICMP keyword

EICMP is the error-message era of ICMPv4 โœจ same deal as before: these depend on sadc's -S SNMP option to be collected. SNMP names, in brackets, as always:

  • ierr/s โ€” number of ICMP messages per second the entity received but clocked as having ICMP-specific errors (bad ICMP checksums, bad length, etc.) [icmpInErrors] ๐Ÿ˜ญ
  • oerr/s โ€” number of ICMP messages per second this entity did not send because of problems found inside ICMP, like a lack of buffers [icmpOutErrors]
  • idstunr/s โ€” number of ICMP Destination Unreachable messages received per second [icmpInDestUnreachs]
  • odstunr/s โ€” number of ICMP Destination Unreachable messages sent per second [icmpOutDestUnreachs]
  • itmex/s โ€” number of ICMP Time Exceeded messages received per second [icmpInTimeExcds]
  • otmex/s โ€” number of ICMP Time Exceeded messages sent per second [icmpOutTimeExcds]
  • iparmpb/s โ€” number of ICMP Parameter Problem messages received per second [icmpInParmProbs]
  • oparmpb/s โ€” number of ICMP Parameter Problem messages sent per second [icmpOutParmProbs]
  • isrcq/s โ€” number of ICMP Source Quench messages received per second [icmpInSrcQuenchs]
  • osrcq/s โ€” number of ICMP Source Quench messages sent per second [icmpOutSrcQuenchs]
  • iredir/s โ€” number of ICMP Redirect messages received per second [icmpInRedirects]
  • oredir/s โ€” number of ICMP Redirect messages sent per second [icmpOutRedirects]

๐Ÿงš the ICMP6 keyword

now we're in ICMPv6 network traffic territory ๐Ÿฆ‹ these stats depend on sadc's -S IPV6 option being collected โ€” fr fr, don't forget it. formal SNMP names between square brackets:

  • imsg6/s โ€” total number of ICMP messages received by the interface per second, which includes everything counted by ierr6/s [ipv6IfIcmpInMsgs]
  • omsg6/s โ€” total number of ICMP messages this interface tried to send per second [ipv6IfIcmpOutMsgs]
  • iech6/s โ€” number of ICMP Echo (request) messages received by the interface per second [ipv6IfIcmpInEchos]
  • iechr6/s โ€” number of ICMP Echo Reply messages received by the interface per second [ipv6IfIcmpInEchoReplies]
  • oechr6/s โ€” number of ICMP Echo Reply messages sent by the interface per second [ipv6IfIcmpOutEchoReplies]
  • igmbq6/s โ€” number of ICMPv6 Group Membership Query messages received by the interface per second [ipv6IfIcmpInGroupMembQueries]
  • igmbr6/s โ€” number of ICMPv6 Group Membership Response messages received by the interface per second [ipv6IfIcmpInGroupMembResponses]
  • ogmbr6/s โ€” number of ICMPv6 Group Membership Response messages sent per second [ipv6IfIcmpOutGroupMembResponses]
  • igmbrd6/s โ€” number of ICMPv6 Group Membership Reduction messages received by the interface per second [ipv6IfIcmpInGroupMembReductions]
  • ogmbrd6/s โ€” number of ICMPv6 Group Membership Reduction messages sent per second [ipv6IfIcmpOutGroupMembReductions]
  • irtsol6/s โ€” number of ICMP Router Solicit messages received by the interface per second [ipv6IfIcmpInRouterSolicits]
  • ortsol6/s โ€” number of ICMP Router Solicitation messages sent by the interface per second [ipv6IfIcmpOutRouterSolicits]
  • irtad6/s โ€” number of ICMP Router Advertisement messages received by the interface per second [ipv6IfIcmpInRouterAdvertisements]
  • inbsol6/s โ€” number of ICMP Neighbor Solicit messages received by the interface per second [ipv6IfIcmpInNeighborSolicits]
  • onbsol6/s โ€” number of ICMP Neighbor Solicitation messages sent by the interface per second [ipv6IfIcmpOutNeighborSolicits]
  • inbad6/s โ€” number of ICMP Neighbor Advertisement messages received by the interface per second [ipv6IfIcmpInNeighborAdvertisements]
  • onbad6/s โ€” number of ICMP Neighbor Advertisement messages sent by the interface per second [ipv6IfIcmpOutNeighborAdvertisements]

๐Ÿ”ฅ the EICMP6 keyword

and finally the ICMPv6 error messages ๐Ÿ’œ (these also depend on sadc's -S IPV6 option to be collected, obvs). SNMP names in the brackets:

  • ierr6/s โ€” number of ICMP messages per second the interface received but determined as having ICMP-specific errors (bad ICMP checksums, bad length, etc.) [ipv6IfIcmpInErrors]
  • idtunr6/s โ€” number of ICMP Destination Unreachable messages received by the interface per second [ipv6IfIcmpInDestUnreachs]
  • odtunr6/s โ€” number of ICMP Destination Unreachable messages sent by the interface per second [ipv6IfIcmpOutDestUnreachs]
  • itmex6/s โ€” number of ICMP Time Exceeded messages received by the interface per second [ipv6IfIcmpInTimeExcds]
  • otmex6/s โ€” number of ICMP Time Exceeded messages sent by the interface per second [ipv6IfIcmpOutTimeExcds]
  • iprmpb6/s โ€” number of ICMP Parameter Problem messages received by the interface per second [ipv6IfIcmpInParmProblems]
  • oprmpb6/s โ€” number of ICMP Parameter Problem messages sent by the interface per second [ipv6IfIcmpOutParmProblems]
  • iredir6/s โ€” number of Redirect messages received by the interface per second [ipv6IfIcmpInRedirects]
  • oredir6/s โ€” number of Redirect messages sent by the interface by second [ipv6IfIcmpOutRedirects]
  • ipck2b6/s โ€” number of ICMP Packet Too Big messages received by the interface per second [ipv6IfIcmpInPktTooBigs]
  • opck2b6/s โ€” number of ICMP Packet Too Big messages sent by the interface per second [ipv6IfIcmpOutPktTooBigs]

Okay so, quick vibe check before we dive in: every single one of these counters has its formal SNMP name hanging out in square brackets right next to it. That's your iykyk moment โ€” the bracket names are the real ones, the short names are the vibe.

With the IP keyword, we're talking alllll about IPv4 network traffic stats, bestie. ๐Ÿ’™ And listen โ€” IPv4 stats only show up if sadc was run with option -S SNMP, so no -S SNMP, no stats, periodt. Here's the roster of values (formal SNMP names in square brackets, as always):

  • irec/s โ€” total number of input datagrams received from interfaces per second, error ones included, no gatekeeping [ipInReceives].
  • fwddgm/s โ€” number of input datagrams per second where this entity was not the final IP destination, so it tried to find a route to forward them on to that final destination [ipForwDatagrams].
  • idel/s โ€” total number of input datagrams successfully delivered per second to IP user-protocols (ICMP included) [ipInDelivers].
  • orq/s โ€” total number of IP datagrams that local IP user-protocols (ICMP included, again) handed over per second to IP asking for transmission [ipOutRequests]. Heads up though: this counter does not include any datagrams already counted in fwddgm/s. ๐Ÿ’…
  • asmrq/s โ€” number of IP fragments received per second that needed reassembling at this entity [ipReasmReqds].
  • asmok/s โ€” number of IP datagrams successfully re-assembled per second [ipReasmOKs].
  • fragok/s โ€” number of IP datagrams successfully fragmented at this entity per second [ipFragOKs].
  • fragcrt/s โ€” number of IP datagram fragments generated per second as a result of fragmentation at this entity [ipFragCreates].

Now with the EIP keyword, it's giving IPv4 network errors energy ๐Ÿ˜ญ โ€” the messy side of the family. Same deal: these depend on sadc's option -S SNMP to be collected. The values:

  • ihdrerr/s โ€” number of input datagrams discarded per second because their IP headers were a whole mess: bad checksums, version number mismatch, other format errors, time-to-live exceeded, errors found while processing their IP options, etc. [ipInHdrErrors]
  • iadrerr/s โ€” number of input datagrams discarded per second because the IP address in their IP header's destination field wasn't a valid address to be received at this entity. This count includes invalid addresses (e.g., 0.0.0.0) and addresses of unsupported Classes (e.g., Class E). And for entities that aren't IP routers and therefore don't forward datagrams, this counter also includes datagrams discarded because the destination address wasn't a local address [ipInAddrErrors].
  • iukwnpr/s โ€” number of locally-addressed datagrams received successfully but then discarded per second because of an unknown or unsupported protocol [ipInUnknownProtos]. rude, honestly.
  • idisc/s โ€” number of input IP datagrams per second that hit no problems that would stop further processing, but got discarded anyway (like, for lack of buffer space) [ipInDiscards]. Note that this counter does not include any datagrams discarded while awaiting re-assembly.
  • odisc/s โ€” number of output IP datagrams per second that hit no problem preventing transmission to their destination but got discarded anyway (again, lack of buffer space being the classic) [ipOutDiscards]. Also note: this counter would include datagrams counted in fwddgm/s if any such packets met this (discretionary) discard criterion.
  • onort/s โ€” number of IP datagrams discarded per second because no route could be found to transmit them to their destination [ipOutNoRoutes]. Note: this counter includes any packets counted in fwddgm/s that meet this 'no-route' criterion. Also note it includes any datagrams a host can't route because all of its default routers are down. ๐Ÿ’€
  • asmf/s โ€” number of failures detected per second by the IP re-assembly algorithm, for whatever reason (timed out, errors, etc.) [ipReasmFails]. Important nuance: this is not necessarily a count of discarded IP fragments, because some algorithms can lose track of how many fragments there are by combining them as they're received.
  • fragf/s โ€” number of IP datagrams discarded per second because they needed fragmenting at this entity and couldn't be โ€” like when their Don't Fragment flag was set [ipFragFails].

Switching it up: the IP6 keyword reports IPv6 network traffic stats ๐Ÿฆ‹โœจ. And yes, IPv6 statistics depend on sadc's option -S IPV6 to be collected โ€” different flag, don't mix them up. The values:

  • irec6/s โ€” total number of input datagrams received from interfaces per second, including the ones received in error [ipv6IfStatsInReceives].
  • fwddgm6/s โ€” number of output datagrams per second that this entity received and forwarded to their final destinations [ipv6IfStatsOutForwDatagrams].
  • idel6/s โ€” total number of datagrams successfully delivered per second to IPv6 user-protocols (ICMP included) [ipv6IfStatsInDelivers].
  • orq6/s โ€” total number of IPv6 datagrams local IPv6 user-protocols (ICMP included) supplied per second to IPv6 in requests for transmission [ipv6IfStatsOutRequests]. Note that this counter does not include any datagrams counted in fwddgm6/s.
  • asmrq6/s โ€” number of IPv6 fragments received per second that needed reassembling at this interface [ipv6IfStatsReasmReqds].
  • asmok6/s โ€” number of IPv6 datagrams successfully reassembled per second [ipv6IfStatsReasmOKs].
  • imcpck6/s โ€” number of multicast packets received per second by the interface [ipv6IfStatsInMcastPkts].
  • omcpck6/s โ€” number of multicast packets transmitted per second by the interface [ipv6IfStatsOutMcastPkts].
  • fragok6/s โ€” number of IPv6 datagrams successfully fragmented at this output interface per second [ipv6IfStatsOutFragOKs].
  • fragcr6/s โ€” number of output datagram fragments generated per second as a result of fragmentation at this output interface [ipv6IfStatsOutFragCreates].

And the EIP6 keyword? That's IPv6 network errors ๐ŸŒธ โ€” yep, it's the same depend-on-sadc's-option--S IPV6 situation, and yep, brackets mean formal SNMP names. Behold:

  • ihdrer6/s โ€” number of input datagrams discarded per second due to errors in their IPv6 headers: version number mismatch, other format errors, hop count exceeded, errors discovered while processing their IPv6 options, etc. [ipv6IfStatsInHdrErrors]
  • iadrer6/s โ€” number of input datagrams discarded per second because the IPv6 address in their IPv6 header's destination field wasn't a valid address to be received at this entity. This count includes invalid addresses (e.g., ::0) and unsupported addresses (e.g., addresses with unallocated prefixes). For entities that aren't IPv6 routers and therefore don't forward datagrams, this counter also includes datagrams discarded because the destination address wasn't a local address [ipv6IfStatsInAddrErrors].
  • iukwnp6/s โ€” number of locally-addressed datagrams received successfully but discarded per second because of an unknown or unsupported protocol [ipv6IfStatsInUnknownProtos].
  • i2big6/s โ€” number of input datagrams that could not be forwarded per second because their size exceeded the link MTU of the outgoing interface [ipv6IfStatsInTooBigErrors]. too big, too slay, too discarded.
  • idisc6/s โ€” number of input IPv6 datagrams per second with no problems preventing continued processing, but discarded anyway (lack of buffer space, the usual suspect) [ipv6IfStatsInDiscards]. Note that this counter does not include any datagrams discarded while awaiting re-assembly.
  • odisc6/s โ€” number of output IPv6 datagrams per second with no problem preventing transmission to their destination, but discarded anyway (buffer space, etc.) [ipv6IfStatsOutDiscards]. Note that this counter would include datagrams counted in fwddgm6/s if any such packets met this (discretionary) discard criterion.
  • inort6/s โ€” number of input datagrams discarded per second because no route could be found to transmit them to their destination [ipv6IfStatsInNoRoutes].
  • onort6/s โ€” number of locally generated IP datagrams discarded per second because no route could be found to transmit them to their destination [unknown formal SNMP name]. yes, that bracket really does say unknown formal SNMP name โ€” it's not a typo, that's just the lore ๐Ÿ™ˆ
  • asmf6/s โ€” the number of failures the IPv6 reassembly algorithm caught per second, for literally whatever reason (timed out, errors, etc.) โ€” that's [ipv6IfStatsReasmFails] bestie. Quick heads up tho: this is not necessarily a count of discarded IPv6 fragments, because some algorithms can lose track of the fragment count by combining them as they come in. so the vibes are approximate, not exact ๐Ÿ’…
  • fragf6/s โ€” how many IPv6 datagrams got yeeted per second because they needed fragmenting at this output interface but just... couldn't โ€” [ipv6IfStatsOutFragFails]. it's giving "we tried and we failed" ๐Ÿ˜ญ
  • itrpck6/s โ€” the number of input datagrams discarded per second because the datagram frame didn't carry enough data โ€” [ipv6IfStatsInTruncatedPkts]. short king packets, not slaying ๐ŸŒธ

๐ŸŒˆ the NFS keyword โ€” client tea

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

  • call/s โ€” number of RPC requests made per second.
  • retrans/s โ€” number of RPC requests per second that needed to be retransmitted (for example, because a server timed out). the flaky wifi of RPC ๐Ÿ”ฅ
  • read/s โ€” number of 'read' RPC calls made per second.
  • write/s โ€” number of 'write' RPC calls made per second.
  • access/s โ€” number of 'access' RPC calls made per second.
  • getatt/s โ€” number of 'getattr' RPC calls made per second.

๐Ÿ‘‘ the NFSD keyword โ€” server tea

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

  • scall/s โ€” number of RPC requests received per second.
  • badcall/s โ€” number of bad RPC requests received per second โ€” the ones whose processing generated an error. blocked and reported ๐Ÿ’€
  • packet/s โ€” number of network packets received per second.
  • udp/s โ€” number of UDP packets received per second.
  • tcp/s โ€” number of TCP packets received per second.
  • hit/s โ€” number of reply cache hits per second. slay โœจ
  • miss/s โ€” number of reply cache misses per second. not slay ๐Ÿ™ˆ
  • sread/s โ€” number of 'read' RPC calls received per second.
  • swrite/s โ€” number of 'write' RPC calls received per second.
  • saccess/s โ€” number of 'access' RPC calls received per second.
  • sgetatt/s โ€” number of 'getattr' RPC calls received per second.

๐Ÿงš the SOCK keyword โ€” IPv4 sockets in use

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

  • totsck โ€” total number of sockets used by the system.
  • tcpsck โ€” number of TCP sockets currently in use.
  • udpsck โ€” number of UDP sockets currently in use.
  • rawsck โ€” number of RAW sockets currently in use.
  • ip-frag โ€” number of IP fragments currently in queue.
  • tcp-tw โ€” number of TCP sockets in TIME_WAIT state. they're just standing there... waiting... ๐Ÿซถ

๐Ÿฆ‹ the SOCK6 keyword โ€” IPv6 sockets in use

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:

  • tcp6sck โ€” number of TCPv6 sockets currently in use.
  • udp6sck โ€” number of UDPv6 sockets currently in use.
  • raw6sck โ€” number of RAWv6 sockets currently in use.
  • ip6-frag โ€” number of IPv6 fragments currently in use.

โญ the SOFT keyword โ€” software-based network processing

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

  • total/s โ€” the total number of network frames processed per second.
  • dropd/s โ€” the total number of network frames dropped per second because there was no room on the processing queue. full queue behavior, tragic ๐Ÿ˜ญ
  • squeezd/s โ€” the number of times the softirq handler function terminated per second because its budget was consumed or the time limit was reached โ€” but more work could have been done. so much potential, so little time ๐Ÿ’€
  • rx_rps/s โ€” the number of times the CPU has been woken up per second to process packets via an inter-processor interrupt.
  • flw_lim/s โ€” the number of times the flow limit has been reached per second. Flow limiting is an optional RPS feature that can be used to limit the number of packets queued to the backlog for each flow to a certain amount. This can help ensure that smaller flows are processed even though much larger flows are pushing packets in. it's giving "let the little guys through" ๐Ÿซถ
  • blg_len โ€” the length of the network backlog.

๐Ÿ”ฅ the TCP keyword โ€” TCPv4 traffic

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):

  • active/s โ€” the number of times TCP connections have made a direct transition to the SYN-SENT state from the CLOSED state per second [tcpActiveOpens]. main character energy, initiating โœจ
  • passive/s โ€” the number of times TCP connections have made a direct transition to the SYN-RCVD state from the LISTEN state per second [tcpPassiveOpens].
  • iseg/s โ€” the total number of segments received per second, including those received in error [tcpInSegs]. This count includes segments received on currently established connections.
  • oseg/s โ€” the total number of segments sent per second, including those on current connections but excluding those containing only retransmitted octets [tcpOutSegs].

๐Ÿ’œ the ETCP keyword โ€” TCPv4 errors

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):

  • atmptf/s โ€” the number of times per second TCP connections have made a direct transition to the CLOSED state from either the SYN-SENT state or the SYN-RCVD state, plus the number of times per second TCP connections have made a direct transition to the LISTEN state from the SYN-RCVD state [tcpAttemptFails]. it didn't work out, no hard feelings ๐Ÿ˜ญ
  • estres/s โ€” the number of times per second TCP connections have made a direct transition to the CLOSED state from either the ESTABLISHED state or the CLOSE-WAIT state [tcpEstabResets]. the breakup stat ๐Ÿ’€
  • retrseg/s โ€” the total number of segments retransmitted per second โ€” that is, the number of TCP segments transmitted containing one or more previously transmitted octets [tcpRetransSegs]. round two, we go again ๐Ÿ”ฅ
  • isegerr/s โ€” the total number of segments received in error (e.g., bad TCP checksums) per second [tcpInErrs].
  • orsts/s โ€” the number of TCP segments sent per second containing the RST flag [tcpOutRsts]. hanging up with attitude ๐ŸŽ€

๐ŸŒธ the UDP keyword โ€” UDPv4 traffic

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):

  • idgm/s โ€” the total number of UDP datagrams delivered per second to UDP users [udpInDatagrams].
  • odgm/s โ€” the total number of UDP datagrams sent per second from this entity [udpOutDatagrams].
  • noport/s โ€” the total number of received UDP datagrams per second for which there was no application at the destination port [udpNoPorts]. nobody home, iconic ๐Ÿ™ˆ
  • idgmerr/s โ€” the number of received UDP datagrams per second that could not be delivered for reasons other than the lack of an application at the destination port [udpInErrors].

๐ŸŽ€ the UDP6 keyword โ€” UDPv6 traffic

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):

  • idgm6/s โ€” the total number of UDP datagrams delivered per second to UDP users [udpInDatagrams].
  • odgm6/s โ€” the total number of UDP datagrams sent per second from this entity [udpOutDatagrams].
  • noport6/s โ€” the total number of received UDP datagrams per second for which there was no application at the destination port [udpNoPorts].
  • idgmer6/s โ€” the number of received UDP datagrams per second that could not be delivered for reasons other than the lack of an application at the destination port [udpInErrors].

The ALL keyword is equivalent to specifying all the keywords above, and therefore all the network activities are reported. literally the whole buffet, eat up ๐Ÿ“


โœจ more OPTIONS โœจ

  • -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.
ok so -o and -f are NOT friends, bestie. pick one. exclusive means exclusive ๐Ÿ’…
  • -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. no showing up for offline CPUs, they're on a break ๐Ÿ˜Œ
  • -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. she understood the assignment, she made it pretty ๐ŸŽ€โœจ
  • -q [ keyword[,...] | ALL ] โ€” report system load and pressure-stall statistics. ooh tension ๐Ÿ‘€

Possible keywords are CPU, IO, LOAD, MEM and PSI.


๐Ÿ’ป CPU โ€” the pressure one

With the CPU keyword, CPU pressure statistics are reported. Here's what gets displayed:

  • %scpu-10 โ€” percentage of the time that at least some runnable tasks were delayed because the CPU was unavailable to them, over the last 10 second window.
  • %scpu-60 โ€” percentage of the time that at least some runnable tasks were delayed because the CPU was unavailable to them, over the last 60 second window.
  • %scpu-300 โ€” percentage of the time that at least some runnable tasks were delayed because the CPU was unavailable to them, over the last 300 second window.
  • %scpu โ€” percentage of the time that at least some runnable tasks were delayed because the CPU was unavailable to them, over the last time interval.

๐Ÿ—‚๏ธ IO โ€” I/O pressure, bestie

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

  • %sio-10 โ€” percentage of the time that at least some tasks lost waiting for I/O, over the last 10 second window.
  • %sio-60 โ€” percentage of the time that at least some tasks lost waiting for I/O, over the last 60 second window.
  • %sio-300 โ€” percentage of the time that at least some tasks lost waiting for I/O, over the last 300 second window.
  • %sio โ€” percentage of the time that at least some tasks lost waiting for I/O, over the last time interval.
  • %fio-10 โ€” percentage of the time during which all non-idle tasks were stalled waiting for I/O, over the last 10 second window.
  • %fio-60 โ€” percentage of the time during which all non-idle tasks were stalled waiting for I/O, over the last 60 second window.
  • %fio-300 โ€” percentage of the time during which all non-idle tasks were stalled waiting for I/O, over the last 300 second window.
  • %fio โ€” percentage of the time during which all non-idle tasks were stalled waiting for I/O, over the last time interval.

๐Ÿ“Š LOAD โ€” queue length + load averages

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

  • runq-sz โ€” run queue length (number of tasks running or waiting for run time).
  • plist-sz โ€” number of tasks in the task list.
  • ldavg-1 โ€” system load average for the last minute. The load average is calculated as the average number of runnable or running tasks (R state), and the number of tasks in uninterruptible sleep (D state) over the specified interval.
  • ldavg-5 โ€” system load average for the past 5 minutes.
  • ldavg-15 โ€” system load average for the past 15 minutes.
  • blocked โ€” number of tasks currently blocked, waiting for I/O to complete.

๐Ÿง  MEM โ€” memory pressure, obviously

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

  • %smem-10 โ€” percentage of the time during which at least some tasks were waiting for memory resources, over the last 10 second window.
  • %smem-60 โ€” percentage of the time during which at least some tasks were waiting for memory resources, over the last 60 second window.
  • %smem-300 โ€” percentage of the time during which at least some tasks were waiting for memory resources, over the last 300 second window.
  • %smem โ€” percentage of the time during which at least some tasks were waiting for memory resources, over the last time interval.
  • %fmem-10 โ€” percentage of the time during which all non-idle tasks were stalled waiting for memory resources, over the last 10 second window.
  • %fmem-60 โ€” percentage of the time during which all non-idle tasks were stalled waiting for memory resources, over the last 60 second window.
  • %fmem-300 โ€” percentage of the time during which all non-idle tasks were stalled waiting for memory resources, over the last 300 second window.
  • %fmem โ€” percentage of the time during which all non-idle tasks were stalled waiting for memory resources, over the last time interval.

The PSI keyword is literally the same thing as specifying the CPU, IO and MEM keywords together, so all the pressure-stall statistics get reported. Two birds, one flag, no cap โœจ

The ALL keyword is equivalent to specifying all the keywords above, so every single statistic shows up. It's giving "select all" energy ๐Ÿ’…


  • -r [ ALL ] โ€” report memory utilization statistics. The ALL keyword means all the memory fields should be displayed. The following values may be displayed:
    • kbmemfree โ€” amount of free memory available in kibibytes.
    • kbavail โ€” estimate of how much memory in kibibytes is available for starting new applications, without swapping. The estimate takes into account that the system needs some page cache to function well, and that not all reclaimable slab will be reclaimable, due to items being in use. The impact of those factors will vary from system to system. If not provided by the kernel, this field is the same as kbmemfree.
    • kbmemused โ€” amount of used memory in kibibytes (calculated as total installed memory - kbavail).
    • %memused โ€” percentage of used memory.
    • kbbuffers โ€” amount of memory used as buffers by the kernel in kibibytes.
    • kbcached โ€” amount of memory used to cache data by the kernel in kibibytes.
    • kbcommit โ€” amount of memory in kibibytes needed for current workload. This is an estimate of how much RAM/swap is needed to guarantee that there never is out of memory.
    • %commit โ€” percentage of memory needed for current workload in relation to the total amount of memory (RAM+swap). This number may be greater than 100% because the kernel usually overcommits memory. ๐Ÿ˜ญ (not a bug, it's a feature)
    • kbactive โ€” amount of active memory in kibibytes (memory that has been used more recently and usually not reclaimed unless absolutely necessary).
    • kbinact โ€” amount of inactive memory in kibibytes (memory which has been less recently used. It is more eligible to be reclaimed for other purposes).
    • kbdirty โ€” amount of memory in kibibytes waiting to get written back to the disk.
    • kbshmem โ€” amount of shared memory in kibibytes (memory mostly used by tmpfs).
    • kbanonpg โ€” amount of non-file backed pages in kibibytes mapped into userspace page tables.
    • kbslab โ€” amount of memory in kibibytes used by the kernel to cache data structures for its own use.
    • kbkstack โ€” amount of memory in kibibytes used for kernel stack space.
    • kbpgtbl โ€” amount of memory in kibibytes dedicated to the lowest level of page tables.
    • kbvmused โ€” amount of memory in kibibytes of used virtual address space.
  • -S โ€” report swap space utilization statistics. The following values are displayed:
    • kbswpfree โ€” amount of free swap space in kibibytes.
    • kbswpused โ€” amount of used swap space in kibibytes.
    • %swpused โ€” percentage of used swap space.
    • kbswpcad โ€” amount of cached swap memory in kibibytes. This is memory that once was swapped out, is swapped back in but still also is in the swap area (if memory is needed it doesn't need to be swapped out again because it is already in the swap area. This saves I/O).
    • %swpcad โ€” percentage of cached swap memory in relation to the amount of used swap space.
  • -s [ hh:mm[:ss] ]
  • -s [ seconds_since_the_epoch ] โ€” set the starting time of the data, so sar extracts records time-tagged at, or following, the time you specified. ๐Ÿ• The default starting time is 08:00:00. Hours must be given in 24-hour format, or as the number of seconds since the epoch (given as a 10 digit number). Heads up bestie: this option can be used only when data are read from a file (option -f).
-s [ hh:mm[:ss] ]
-s [ seconds_since_the_epoch ]
  • --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. iykyk ๐Ÿ•ต๏ธโ€โ™€๏ธ
  • -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 local time. Time zone glow-up, iconic โœจ
  • -u [ ALL ] โ€” report CPU utilization. The ALL keyword means all the CPU fields should be displayed. The report may show the following fields:
    • %user โ€” percentage of CPU utilization that occurred while executing at the user level (application). Note that this field includes time spent running virtual processors.
    • %usr โ€” percentage of CPU utilization that occurred while executing at the user level (application). Note that this field does NOT include time spent running virtual processors. ๐Ÿ‘€
    • %nice โ€” percentage of CPU utilization that occurred while executing at the user level with nice priority.
  • %system โ€” Percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this field includes time spent servicing hardware and software interrupts. ๐Ÿ’…
  • %sys โ€” Percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this field does NOT include time spent servicing hardware or software interrupts. Read that twice, bestie.
  • %iowait โ€” Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
  • %steal โ€” Percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
  • %irq โ€” Percentage of time spent by the CPU or CPUs to service hardware interrupts.
  • %soft โ€” Percentage of time spent by the CPU or CPUs to service software interrupts.
  • %guest โ€” Percentage of time spent by the CPU or CPUs to run a virtual processor.
  • %gnice โ€” Percentage of time spent by the CPU or CPUs to run a niced guest.
  • %idle โ€” Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
  • -V โ€” Print version number then exit. Short, sweet, iconic.
  • -v โ€” Report status of inode, file and other kernel tables. The following values are displayed:
    • dentunusd โ€” Number of unused cache entries in the directory cache.
    • file-nr โ€” Number of file handles used by the system.
    • inode-nr โ€” Number of inode handlers used by the system.
    • pty-nr โ€” Number of pseudo-terminals used by the system.
  • -W โ€” Report swapping statistics. The following values are displayed:
    • pswpin/s โ€” Total number of swap pages the system brought in per second.
    • pswpout/s โ€” Total number of swap pages the system brought out per second.
  • -w โ€” Report task creation and system switching activity. The following values are displayed:
    • proc/s โ€” Total number of tasks created per second.
    • cswch/s โ€” Total number of context switches per second.
  • -x โ€” Extended reports: Display minimum and maximum values in addition to average ones at the end of the report. Extra detail, extra slay. โœจ
  • -y โ€” Report TTY devices activity. The following values are displayed:
    • rcvin/s โ€” Number of receive interrupts per second for current serial line. Serial line number is given in the TTY column.
    • xmtin/s โ€” Number of transmit interrupts per second for current serial line.
    • framerr/s โ€” Number of frame errors per second for current serial line.
    • prtyerr/s โ€” Number of parity errors per second for current serial line.
    • brk/s โ€” Number of breaks per second for current serial line.
    • ovrun/s โ€” Number of overrun errors per second for current serial line.
  • -z โ€” Tell sar to omit output for any devices for which there was no activity during the sample period. Quiet devices get no screen time. ๐ŸŽ€

๐ŸŒฟ 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. Color = range info, not drama. ๐Ÿ‘‘
  • 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:I=32;22:N=34;1:R=31;22:W=35;1:X=31;1:Z=34;22+=32;1:-=31;1

Supported capabilities are:

  • C= โ€” SGR (Select Graphic Rendition) substring for comments inserted in the binary daily data files.
  • I= โ€” SGR substring for item names or values (eg. network interfaces, CPU number...).
  • N= โ€” SGR substring for non-zero statistics values.
  • R= โ€” SGR substring for restart messages.
  • W= (or M=) โ€” SGR substring for percentage values in the range from 75% to 90% (or in the range 10% to 25% depending on the metric's meaning). It is also used for negative values in the range from -10 to -5.
  • X= (or H=) โ€” SGR substring for percentage values greater than or equal to 90% (or lower than or equal to 10% depending on the metric's meaning). It is also used for negative values lower than or equal to -10.
  • Z= โ€” SGR substring for zero values.
  • += โ€” SGR substring for battery status (full or charging).
  • -= โ€” SGR substring for battery status (not charging or discharging).
  • S_REPEAT_HEADER โ€” This variable contains the maximum number of lines after which a header has to be displayed by sar when the output is not a terminal. Header repetition, but make it configurable.
  • 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/sa 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. Date format glow-up. โœจ

๐Ÿงช EXAMPLES ๐Ÿงช

sar -u 2 5

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

sar -I --int=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/sa/sa16

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

sar -A

Display all the statistics saved in current daily data file. All the stats, no crumbs left. ๐Ÿ’…


๐Ÿ’€ BUGS ๐Ÿ’€

/proc filesystem must be mounted for the sar command to work. No /proc, no party. ๐Ÿ˜ญ

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 displays units corresponding to 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. Yes, the labels are a little sus โ€” the math is still 1024-based.


๐Ÿ“ FILES ๐Ÿ“

  • /var/log/sa/saDD
  • /var/log/sa/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

https://sysstat.github.io/


That's the page, bestie. Source/version line says Linux, date says AUGUST 2026, and this iconic little manual is SAR(1) โ€” periodt. ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from