Linux "sar" Command Line Options and Examples
Collect, report, or save system activity information.

The sar command writes to standard output the contents of selected cumulative activity counters in the operat‐ ing system. The accounting system, based on the values in the count and interval parameters, writes informa‐ tion the specified number of times spaced at the specified intervals in seconds.


Usage:

sar [ -A ] [ -B ] [ -b ] [ -C ] [ -D ] [ -d ] [ -F [ MOUNT ] ] [ -H ] [ -h ] [ -p ] [ -q ] [ -r [ ALL ] ] [ -S
] [ -t ] [ -u [ ALL ] ] [ -V ] [ -v ] [ -W ] [ -w ] [ -y ] [ --human ] [ --sadc ] [ -I { int_list | SUM | ALL
} ] [ -P { cpu_list | ALL } ] [ -m { keyword [,...] | ALL } ] [ -n { keyword [,...] | ALL } ] [ -j { ID |
LABEL | PATH | UUID | ... } ] [ -f [ filename ] | -o [ filename ] | -[0-9]+ ] [ -i interval ] [ -s [
hh:mm[:ss] ] ] [ -e [ hh:mm[:ss] ] ] [ interval [ count ] ]






Command Line Options:

-A
This is equivalent to specifying -bBdFHqSuvwWy -I SUM -I ALL -m ALL -n ALL -r ALL -u ALL -P ALL.
sar -A ...
-B
pgpgin/sTotal number of kilobytes the system paged in from disk per second.pgpgout/sTotal number of kilobytes the system paged out to disk per second.fault/sNumber of page faults (major + minor) made by the system per second. This is not a count ofpage faults that generate I/O, because some page faults can be resolved without I/O.majflt/sNumber of major faults the system has made per second, those which have required loading a mem‐ory page from disk.pgfree/sNumber of pages placed on the free list by the system per second.pgscank/sNumber of pages scanned by the kswapd daemon per second.pgscand/sNumber of pages scanned directly per second.pgsteal/sNumber of pages the system has reclaimed from cache (pagecache and swapcache) per second to sat‐isfy its memory demands.%vmeffCalculated as pgsteal / pgscan, this is a metric of the efficiency of page reclaim. If it isnear 100% then almost every page coming off the tail of the inactive list is being reaped. If itgets too low (e.g. less than 30%) then the virtual memory is having some difficulty. This fieldis displayed as zero if no pages have been scanned during the interval of time.
sar -B ...
-b
tpsTotal number of transfers per second that were issued to physical devices. A transfer is an I/Orequest to a physical device. Multiple logical requests can be combined into a single I/Orequest to the device. A transfer is of indeterminate size.rtpsTotal number of read requests per second issued to physical devices.wtpsTotal number of write requests per second issued to physical devices.bread/sTotal amount of data read from the devices in blocks per second. Blocks are equivalent to sec‐tors and therefore have a size of 512 bytes.bwrtn/sTotal amount of data written to devices in blocks per second.
sar -b ...
-C
When reading data from a file, tell sar to display comments that have been inserted by sadc.
sar -C ...
-e
Set the ending time of the report. The default ending time is 18:00:00. Hours must be given in 24-hourformat. This option can be used when data are read from or written to a file (options -f or -o).
sar -e ...
-F
Display statistics for currently mounted filesystems. Pseudo-filesystems are ignored. At the end of thereport, sar will display a summary of all those filesystems. Use of the MOUNT parameter keyword indi‐cates that mountpoint will be reported instead of filesystem device. Note that filesystems statisticsdepend on sadc option -S XDISK to be collected.The following values are displayed:MBfsfreeTotal amount a free space in megabytes (including space available only to privileged user).MBfsusedTotal amount of space used in megabytes.%fsusedPercentage of filesystem space used, as seen by a privileged user.%ufsusedPercentage of filesystem space used, as seen by an unprivileged user.IfreeTotal number of free file nodes in filesystem.IusedTotal number of file nodes used in filesystem.%IusedPercentage of file nodes used in filesystem.
sar -F ...
-f
Extract records from filename (created by the -o filename flag). The default value of the filenameparameter is the current standard system activity daily data file. If filename is a directory insteadof a plain file then it is considered as the directory where the standard system activity daily datafiles are located. The -f option is exclusive of the -o option.
sar -f ...
-H
kbhugfreeAmount of hugepages memory in kilobytes that is not yet allocated.kbhugusedAmount of hugepages memory in kilobytes that has been allocated.%hugusedPercentage of total hugepages memory that has been allocated.
sar -H ...
-h
Display a short help message then exit.
sar -h ...
--human
Print sizes in human readable format (e.g. 1k, 1.23M, etc.) The units displayed with this optionsupersede any other default units (e.g. kilobytes, sectors...) associated with the metrics.
sar --human ...
-I
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 sec‐ond is to be displayed. The ALL keyword indicates that statistics from all interrupts, including poten‐tial APIC interrupt sources, are to be reported. Note that interrupt statistics depend on sadc option
sar -I ...
-S
INT" to be collected.
sar -S ...
-i
Select data records at seconds as close as possible to the number specified by the interval parameter.
sar -i ...
-j
Display persistent device names. Use this option in conjunction with option -d. Options ID, LABEL,etc. specify the type of the persistent name. These options are not limited, only prerequisite is thatdirectory with required persistent names is present in /dev/disk. If persistent name is not found forthe device, the device name is pretty-printed (see option -p below).
sar -j ...
-m
Report power management statistics. Note that these statistics depend on sadc's option "-S POWER" tobe collected.Possible keywords are CPU, FAN, FREQ, IN, TEMP and USB.With the CPU keyword, statistics about CPU are reported. The following value is displayed:MHzInstantaneous CPU clock frequency in MHz.With the FAN keyword, statistics about fans speed are reported. The following values are displayed:rpmFan speed expressed in revolutions per minute.drpmThis field is calculated as the difference between current fan speed (rpm) and its low limit(fan_min).DEVICESensor device name.With the FREQ keyword, statistics about CPU clock frequency are reported. The following value is dis‐played:wghMHzWeighted average CPU clock frequency in MHz. Note that the cpufreq-stats driver must be com‐piled in the kernel for this option to work.With the IN keyword, statistics about voltage inputs are reported. The following values are displayed:inVVoltage input expressed in Volts.%inRelative 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).DEVICESensor device name.With the TEMP keyword, statistics about devices temperature are reported. The following values aredisplayed:degCDevice temperature expressed in degrees Celsius.%tempRelative device temperature. A value of 100% means that temperature has reached its high limit(temp_max).DEVICESensor device name.With the USB keyword, the sar command takes a snapshot of all the USB devices currently plugged intothe system. At the end of the report, sar will display a summary of all those USB devices. The follow‐ing values are displayed:BUSRoot hub number of the USB device.idvendorVendor ID number (assigned by USB organization).idprodProduct ID number (assigned by Manufacturer).maxpowerMaximum power consumption of the device (expressed in mA).manufactManufacturer name.productProduct name.The ALL keyword is equivalent to specifying all the keywords above and therefore all the power manage‐ment statistics are reported.
sar -m ...
-n
Report 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. The following values are dis‐played:IFACEName of the network interface for which statistics are reported.rxpck/sTotal number of packets received per second.txpck/sTotal number of packets transmitted per second.rxkB/sTotal number of kilobytes received per second.txkB/sTotal number of kilobytes transmitted per second.rxcmp/sNumber of compressed packets received per second (for cslip etc.).txcmp/sNumber of compressed packets transmitted per second.rxmcst/sNumber of multicast packets received per second.%ifutilUtilization percentage of the network interface. For half-duplex interfaces, utilization is cal‐culated using the sum of rxkB/s and txkB/s as a percentage of the interface speed. Forfull-duplex, this is the greater of rxkB/S or txkB/s.With the EDEV keyword, statistics on failures (errors) from the network devices are reported. The fol‐lowing values are displayed:IFACEName of the network interface for which statistics are reported.rxerr/sTotal number of bad packets received per second.txerr/sTotal number of errors that happened per second while transmitting packets.coll/sNumber of collisions that happened per second while transmitting packets.rxdrop/sNumber of received packets dropped per second because of a lack of space in linux buffers.txdrop/sNumber of transmitted packets dropped per second because of a lack of space in linux buffers.txcarr/sNumber of carrier-errors that happened per second while transmitting packets.rxfram/sNumber of frame alignment errors that happened per second on received packets.rxfifo/sNumber of FIFO overrun errors that happened per second on received packets.txfifo/sNumber of FIFO overrun errors that happened per second on transmitted packets.With the FC keyword, statistics about fibre channel traffic are reported. Note that fibre channel sta‐tistics depend on sadc's option "-S DISK" to be collected. The following values are displayed:FCHOSTName of the fibre channel host bus adapter (HBA) interface for which statistics are reported.fch_rxf/sThe total number of frames received per second.fch_txf/sThe total number of frames transmitted per second.fch_rxw/sThe total number of transmission words received per second.fch_txw/sThe total number of transmission words transmitted per second.With the ICMP keyword, statistics about ICMPv4 network traffic are reported. Note that ICMPv4 statis‐tics depend on sadc's option "-S SNMP" to be collected. The following values are displayed (formalSNMP names between square brackets):imsg/sThe total number of ICMP messages which the entity received per second [icmpInMsgs]. Note thatthis counter includes all those counted by ierr/s.omsg/sThe total number of ICMP messages which this entity attempted to send per second [icmpOutMsgs].Note that this counter includes all those counted by oerr/s.iech/sThe number of ICMP Echo (request) messages received per second [icmpInEchos].iechr/sThe number of ICMP Echo Reply messages received per second [icmpInEchoReps].oech/sThe number of ICMP Echo (request) messages sent per second [icmpOutEchos].oechr/sThe number of ICMP Echo Reply messages sent per second [icmpOutEchoReps].itm/sThe number of ICMP Timestamp (request) messages received per second [icmpInTimestamps].itmr/sThe number of ICMP Timestamp Reply messages received per second [icmpInTimestampReps].otm/sThe number of ICMP Timestamp (request) messages sent per second [icmpOutTimestamps].otmr/sThe number of ICMP Timestamp Reply messages sent per second [icmpOutTimestampReps].iadrmk/sThe number of ICMP Address Mask Request messages received per second [icmpInAddrMasks].iadrmkr/sThe number of ICMP Address Mask Reply messages received per second [icmpInAddrMaskReps].oadrmk/sThe number of ICMP Address Mask Request messages sent per second [icmpOutAddrMasks].oadrmkr/sThe number of ICMP Address Mask Reply messages sent per second [icmpOutAddrMaskReps].With the EICMP keyword, statistics about ICMPv4 error messages are reported. Note that ICMPv4 statis‐tics depend on sadc's option "-S SNMP" to be collected. The following values are displayed (formalSNMP names between square brackets):ierr/sThe number of ICMP messages per second which the entity received but determined as havingICMP-specific errors (bad ICMP checksums, bad length, etc.) [icmpInErrors].oerr/sThe number of ICMP messages per second which this entity did not send due to problems discoveredwithin ICMP such as a lack of buffers [icmpOutErrors].idstunr/sThe number of ICMP Destination Unreachable messages received per second [icmpInDestUnreachs].odstunr/sThe number of ICMP Destination Unreachable messages sent per second [icmpOutDestUnreachs].itmex/sThe number of ICMP Time Exceeded messages received per second [icmpInTimeExcds].otmex/sThe number of ICMP Time Exceeded messages sent per second [icmpOutTimeExcds].iparmpb/sThe number of ICMP Parameter Problem messages received per second [icmpInParmProbs].oparmpb/sThe number of ICMP Parameter Problem messages sent per second [icmpOutParmProbs].isrcq/sThe number of ICMP Source Quench messages received per second [icmpInSrcQuenchs].osrcq/sThe number of ICMP Source Quench messages sent per second [icmpOutSrcQuenchs].iredir/sThe number of ICMP Redirect messages received per second [icmpInRedirects].oredir/sThe number of ICMP Redirect messages sent per second [icmpOutRedirects].With the ICMP6 keyword, statistics about ICMPv6 network traffic are reported. Note that ICMPv6 statis‐tics depend on sadc's option "-S IPV6" to be collected. The following values are displayed (formalSNMP names between square brackets):imsg6/sThe total number of ICMP messages received by the interface per second which includes all thosecounted by ierr6/s [ipv6IfIcmpInMsgs].omsg6/sThe total number of ICMP messages which this interface attempted to send per second [ipv6IfIcm‐pOutMsgs].iech6/sThe number of ICMP Echo (request) messages received by the interface per second [ipv6IfIcmpInE‐chos].iechr6/sThe number of ICMP Echo Reply messages received by the interface per second [ipv6IfIcmpInE‐choReplies].oechr6/sThe number of ICMP Echo Reply messages sent by the interface per second [ipv6IfIcmpOutE‐choReplies].igmbq6/sThe number of ICMPv6 Group Membership Query messages received by the interface per second[ipv6IfIcmpInGroupMembQueries].igmbr6/sThe number of ICMPv6 Group Membership Response messages received by the interface per second[ipv6IfIcmpInGroupMembResponses].ogmbr6/sThe number of ICMPv6 Group Membership Response messages sent per second [ipv6IfIcmpOutGroupMem‐bResponses].igmbrd6/sThe number of ICMPv6 Group Membership Reduction messages received by the interface per second[ipv6IfIcmpInGroupMembReductions].ogmbrd6/sThe number of ICMPv6 Group Membership Reduction messages sent per second [ipv6IfIcmpOutGroupMem‐bReductions].irtsol6/sThe number of ICMP Router Solicit messages received by the interface per second [ipv6IfIcmpIn‐RouterSolicits].ortsol6/sThe number of ICMP Router Solicitation messages sent by the interface per second [ipv6IfIcm‐pOutRouterSolicits].irtad6/sThe number of ICMP Router Advertisement messages received by the interface per second[ipv6IfIcmpInRouterAdvertisements].inbsol6/sThe number of ICMP Neighbor Solicit messages received by the interface per second [ipv6IfIcmpIn‐NeighborSolicits].onbsol6/sThe number of ICMP Neighbor Solicitation messages sent by the interface per second [ipv6IfIcm‐pOutNeighborSolicits].inbad6/sThe number of ICMP Neighbor Advertisement messages received by the interface per second[ipv6IfIcmpInNeighborAdvertisements].onbad6/sThe number of ICMP Neighbor Advertisement messages sent by the interface per second [ipv6IfIcm‐pOutNeighborAdvertisements].With the EICMP6 keyword, statistics about ICMPv6 error messages are reported. Note that ICMPv6 statis‐tics depend on sadc's option "-S IPV6" to be collected. The following values are displayed (formalSNMP names between square brackets):ierr6/sThe number of ICMP messages per second which the interface received but determined as havingICMP-specific errors (bad ICMP checksums, bad length, etc.) [ipv6IfIcmpInErrors]idtunr6/sThe number of ICMP Destination Unreachable messages received by the interface per second[ipv6IfIcmpInDestUnreachs].odtunr6/sThe number of ICMP Destination Unreachable messages sent by the interface per second [ipv6IfIcm‐pOutDestUnreachs].itmex6/sThe number of ICMP Time Exceeded messages received by the interface per second [ipv6IfIcmpIn‐TimeExcds].otmex6/sThe number of ICMP Time Exceeded messages sent by the interface per second [ipv6IfIcmpOutTimeEx‐cds].iprmpb6/sThe number of ICMP Parameter Problem messages received by the interface per second [ipv6IfIcmp‐InParmProblems].oprmpb6/sThe number of ICMP Parameter Problem messages sent by the interface per second [ipv6IfIcmpOut‐ParmProblems].iredir6/sThe number of Redirect messages received by the interface per second [ipv6IfIcmpInRedirects].oredir6/sThe number of Redirect messages sent by the interface by second [ipv6IfIcmpOutRedirects].ipck2b6/sThe number of ICMP Packet Too Big messages received by the interface per second [ipv6IfIcmpInPk‐tTooBigs].opck2b6/sThe number of ICMP Packet Too Big messages sent by the interface per second [ipv6IfIcmpOutPkt‐TooBigs].With the IP keyword, statistics about IPv4 network traffic are reported. Note that IPv4 statisticsdepend on sadc's option "-S SNMP" to be collected. The following values are displayed (formal SNMPnames between square brackets):irec/sThe total number of input datagrams received from interfaces per second, including thosereceived in error [ipInReceives].fwddgm/sThe number of input datagrams per second, for which this entity was not their final IP destina‐tion, as a result of which an attempt was made to find a route to forward them to that finaldestination [ipForwDatagrams].idel/sThe total number of input datagrams successfully delivered per second to IP user-protocols(including ICMP) [ipInDelivers].orq/sThe total number of IP datagrams which local IP user-protocols (including ICMP) supplied persecond to IP in requests for transmission [ipOutRequests]. Note that this counter does notinclude any datagrams counted in fwddgm/s.asmrq/sThe number of IP fragments received per second which needed to be reassembled at this entity[ipReasmReqds].asmok/sThe number of IP datagrams successfully re-assembled per second [ipReasmOKs].fragok/sThe number of IP datagrams that have been successfully fragmented at this entity per second[ipFragOKs].fragcrt/sThe number of IP datagram fragments that have been generated per second as a result of fragmen‐tation at this entity [ipFragCreates].With the EIP keyword, statistics about IPv4 network errors are reported. Note that IPv4 statisticsdepend on sadc's option "-S SNMP" to be collected. The following values are displayed (formal SNMPnames between square brackets):ihdrerr/sThe number of input datagrams discarded per second due to errors in their IP headers, includingbad checksums, version number mismatch, other format errors, time-to-live exceeded, errors dis‐covered in processing their IP options, etc. [ipInHdrErrors]iadrerr/sThe number of input datagrams discarded per second because the IP address in their IP header'sdestination field was not a valid address to be received at this entity. This count includesinvalid addresses (e.g., 0.0.0.0) and addresses of unsupported Classes (e.g., Class E). Forentities which are not IP routers and therefore do not forward datagrams, this counter includesdatagrams discarded because the destination address was not a local address [ipInAddrErrors].iukwnpr/sThe number of locally-addressed datagrams received successfully but discarded per second becauseof an unknown or unsupported protocol [ipInUnknownProtos].idisc/sThe number of input IP datagrams per second for which no problems were encountered to preventtheir continued processing, but which were discarded (e.g., for lack of buffer space) [ipInDis‐cards]. Note that this counter does not include any datagrams discarded while awaitingre-assembly.odisc/sThe number of output IP datagrams per second for which no problem was encountered to preventtheir transmission to their destination, but which were discarded (e.g., for lack of bufferspace) [ipOutDiscards]. Note that this counter would include datagrams counted in fwddgm/s ifany such packets met this (discretionary) discard criterion.onort/sThe number of IP datagrams discarded per second because no route could be found to transmit themto their destination [ipOutNoRoutes]. Note that this counter includes any packets counted infwddgm/s which meet this 'no-route' criterion. Note that this includes any datagrams which ahost cannot route because all of its default routers are down.asmf/sThe number of failures detected per second by the IP re-assembly algorithm (for whatever reason:timed out, errors, etc) [ipReasmFails]. Note that this is not necessarily a count of discardedIP fragments since some algorithms can lose track of the number of fragments by combining themas they are received.fragf/sThe number of IP datagrams that have been discarded per second because they needed to be frag‐mented at this entity but could not be, e.g., because their Don't Fragment flag was set [ipFrag‐Fails].With the IP6 keyword, statistics about IPv6 network traffic are reported. Note that IPv6 statisticsdepend on sadc's option "-S IPV6" to be collected. The following values are displayed (formal SNMPnames between square brackets):irec6/sThe total number of input datagrams received from interfaces per second, including thosereceived in error [ipv6IfStatsInReceives].fwddgm6/sThe number of output datagrams per second which this entity received and forwarded to theirfinal destinations [ipv6IfStatsOutForwDatagrams].idel6/sThe total number of datagrams successfully delivered per second to IPv6 user-protocols (includ‐ing ICMP) [ipv6IfStatsInDelivers].orq6/sThe total number of IPv6 datagrams which local IPv6 user-protocols (including ICMP) supplied persecond to IPv6 in requests for transmission [ipv6IfStatsOutRequests]. Note that this counterdoes not include any datagrams counted in fwddgm6/s.asmrq6/sThe number of IPv6 fragments received per second which needed to be reassembled at this inter‐face [ipv6IfStatsReasmReqds].asmok6/sThe number of IPv6 datagrams successfully reassembled per second [ipv6IfStatsReasmOKs].imcpck6/sThe number of multicast packets received per second by the interface [ipv6IfStatsInMcastPkts].omcpck6/sThe number of multicast packets transmitted per second by the interface [ipv6IfStatsOutMcastP‐kts].fragok6/sThe number of IPv6 datagrams that have been successfully fragmented at this output interface persecond [ipv6IfStatsOutFragOKs].fragcr6/sThe number of output datagram fragments that have been generated per second as a result of frag‐mentation at this output interface [ipv6IfStatsOutFragCreates].With the EIP6 keyword, statistics about IPv6 network errors are reported. Note that IPv6 statisticsdepend on sadc's option "-S IPV6" to be collected. The following values are displayed (formal SNMPnames between square brackets):ihdrer6/sThe number of input datagrams discarded per second due to errors in their IPv6 headers, includ‐ing version number mismatch, other format errors, hop count exceeded, errors discovered in pro‐cessing their IPv6 options, etc. [ipv6IfStatsInHdrErrors]iadrer6/sThe number of input datagrams discarded per second because the IPv6 address in their IPv6header's destination field was not a valid address to be received at this entity. This countincludes invalid addresses (e.g., ::0) and unsupported addresses (e.g., addresses with unallo‐cated prefixes). For entities which are not IPv6 routers and therefore do not forward datagrams,this counter includes datagrams discarded because the destination address was not a localaddress [ipv6IfStatsInAddrErrors].iukwnp6/sThe number of locally-addressed datagrams received successfully but discarded per second becauseof an unknown or unsupported protocol [ipv6IfStatsInUnknownProtos].i2big6/sThe number of input datagrams that could not be forwarded per second because their size exceededthe link MTU of outgoing interface [ipv6IfStatsInTooBigErrors].idisc6/sThe number of input IPv6 datagrams per second for which no problems were encountered to preventtheir continued processing, but which were discarded (e.g., for lack of buffer space) [ipv6IfS‐tatsInDiscards]. Note that this counter does not include any datagrams discarded while awaitingre-assembly.odisc6/sThe number of output IPv6 datagrams per second for which no problem was encountered to preventtheir transmission to their destination, but which were discarded (e.g., for lack of bufferspace) [ipv6IfStatsOutDiscards]. Note that this counter would include datagrams counted in fwd‐dgm6/s if any such packets met this (discretionary) discard criterion.inort6/sThe number of input datagrams discarded per second because no route could be found to transmitthem to their destination [ipv6IfStatsInNoRoutes].onort6/sThe number of locally generated IP datagrams discarded per second because no route could befound to transmit them to their destination [unknown formal SNMP name].asmf6/sThe number of failures detected per second by the IPv6 re-assembly algorithm (for whatever rea‐son: timed out, errors, etc.) [ipv6IfStatsReasmFails]. Note that this is not necessarily acount of discarded IPv6 fragments since some algorithms can lose track of the number of frag‐ments by combining them as they are received.fragf6/sThe number of IPv6 datagrams that have been discarded per second because they needed to be frag‐mented at this output interface but could not be [ipv6IfStatsOutFragFails].itrpck6/sThe number of input datagrams discarded per second because datagram frame didn't carry enoughdata [ipv6IfStatsInTruncatedPkts].With the NFS keyword, statistics about NFS client activity are reported. The following values are dis‐played:call/sNumber of RPC requests made per second.retrans/sNumber of RPC requests per second, those which needed to be retransmitted (for example becauseof a server timeout).read/sNumber of 'read' RPC calls made per second.write/sNumber of 'write' RPC calls made per second.access/sNumber of 'access' RPC calls made per second.getatt/sNumber of 'getattr' RPC calls made per second.With the NFSD keyword, statistics about NFS server activity are reported. The following values aredisplayed:scall/sNumber of RPC requests received per second.badcall/sNumber of bad RPC requests received per second, those whose processing generated an error.packet/sNumber of network packets received per second.udp/sNumber of UDP packets received per second.tcp/sNumber of TCP packets received per second.hit/sNumber of reply cache hits per second.miss/sNumber of reply cache misses per second.sread/sNumber of 'read' RPC calls received per second.swrite/sNumber of 'write' RPC calls received per second.saccess/sNumber of 'access' RPC calls received per second.sgetatt/sNumber of 'getattr' RPC calls received per second.With the SOCK keyword, statistics on sockets in use are reported (IPv4). The following values are dis‐played:totsckTotal number of sockets used by the system.tcpsckNumber of TCP sockets currently in use.udpsckNumber of UDP sockets currently in use.rawsckNumber of RAW sockets currently in use.ip-fragNumber of IP fragments currently in queue.tcp-twNumber of TCP sockets in TIME_WAIT state.With the SOCK6 keyword, statistics on sockets in use are reported (IPv6). Note that IPv6 statisticsdepend on sadc's option "-S IPV6" to be collected. The following values are displayed:tcp6sckNumber of TCPv6 sockets currently in use.udp6sckNumber of UDPv6 sockets currently in use.raw6sckNumber of RAWv6 sockets currently in use.ip6-fragNumber of IPv6 fragments currently in use.With the SOFT keyword, statistics about software-based network processing are reported. The followingvalues are displayed:total/sThe total number of network frames processed per second.dropd/sThe total number of network frames dropped per second because there was no room on the process‐ing queue.squeezd/sThe number of times the softirq handler function terminated per second because its budget wasconsumed or the time limit was reached, but more work could have been done.rx_rps/sThe number of times the CPU has been woken up per second to process packets via an inter-proces‐sor interrupt.flw_lim/sThe number of times the flow limit has been reached per second. Flow limiting is an optionalRPS feature that can be used to limit the number of packets queued to the backlog for each flowto a certain amount. This can help ensure that smaller flows are processed even though muchlarger flows are pushing packets in.With the TCP keyword, statistics about TCPv4 network traffic are reported. Note that TCPv4 statisticsdepend on sadc's option "-S SNMP" to be collected. The following values are displayed (formal SNMPnames between square brackets):active/sThe number of times TCP connections have made a direct transition to the SYN-SENT state from theCLOSED state per second [tcpActiveOpens].passive/sThe number of times TCP connections have made a direct transition to the SYN-RCVD state from theLISTEN state per second [tcpPassiveOpens].iseg/sThe total number of segments received per second, including those received in error [tcpInSegs].This count includes segments received on currently established connections.oseg/sThe total number of segments sent per second, including those on current connections but exclud‐ing those containing only retransmitted octets [tcpOutSegs].With the ETCP keyword, statistics about TCPv4 network errors are reported. Note that TCPv4 statisticsdepend on sadc's option "-S SNMP" to be collected. The following values are displayed (formal SNMPnames between square brackets):atmptf/sThe number of times per second TCP connections have made a direct transition to the CLOSED statefrom either the SYN-SENT state or the SYN-RCVD state, plus the number of times per second TCPconnections have made a direct transition to the LISTEN state from the SYN-RCVD state [tcpAt‐temptFails].estres/sThe number of times per second TCP connections have made a direct transition to the CLOSED statefrom either the ESTABLISHED state or the CLOSE-WAIT state [tcpEstabResets].retrans/sThe total number of segments retransmitted per second - that is, the number of TCP segmentstransmitted containing one or more previously transmitted octets [tcpRetransSegs].isegerr/sThe total number of segments received in error (e.g., bad TCP checksums) per second [tcpInErrs].orsts/sThe number of TCP segments sent per second containing the RST flag [tcpOutRsts].With the UDP keyword, statistics about UDPv4 network traffic are reported. Note that UDPv4 statisticsdepend on sadc's option "-S SNMP" to be collected. The following values are displayed (formal SNMPnames between square brackets):idgm/sThe total number of UDP datagrams delivered per second to UDP users [udpInDatagrams].odgm/sThe total number of UDP datagrams sent per second from this entity [udpOutDatagrams].noport/sThe total number of received UDP datagrams per second for which there was no application at thedestination port [udpNoPorts].idgmerr/sThe number of received UDP datagrams per second that could not be delivered for reasons otherthan the lack of an application at the destination port [udpInErrors].With the UDP6 keyword, statistics about UDPv6 network traffic are reported. Note that UDPv6 statisticsdepend on sadc's option "-S IPV6" to be collected. The following values are displayed (formal SNMPnames between square brackets):idgm6/sThe total number of UDP datagrams delivered per second to UDP users [udpInDatagrams].odgm6/sThe total number of UDP datagrams sent per second from this entity [udpOutDatagrams].noport6/sThe total number of received UDP datagrams per second for which there was no application at thedestination port [udpNoPorts].idgmer6/sThe number of received UDP datagrams per second that could not be delivered for reasons otherthan 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 activ‐ities are reported.
sar -n ...
-o
Save the readings in the file in binary form. Each reading is in a separate record. The default valueof the filename parameter is the current standard system activity daily data file. If filename is adirectory instead of a plain file then it is considered as the directory where the standard systemactivity daily data files are located. The -o option is exclusive of the -f option. All the dataavailable from the kernel are saved in the file (in fact, sar calls its data collector sadc with theoption "-S ALL". See sadc(8) manual page).
sar -o ...
-P
Report per-processor statistics for the specified processor or processors. cpu_list is a list ofcomma-separated values or range of values (e.g., 0,2,4-7,12-). Note that processor 0 is the first pro‐cessor, and processor all is the global average among all processors. Specifying the ALL keywordreports statistics for each individual processor, and globally for all processors.
sar -P ...
-q
runq-szRun queue length (number of tasks waiting for run time).plist-szNumber of tasks in the task list.ldavg-1System load average for the last minute. The load average is calculated as the average numberof runnable or running tasks (R state), and the number of tasks in uninterruptible sleep (Dstate) over the specified interval.ldavg-5System load average for the past 5 minutes.ldavg-15System load average for the past 15 minutes.blockedNumber of tasks currently blocked, waiting for I/O to complete.
sar -q ...
-r
Report memory utilization statistics. The ALL keyword indicates that all the memory fields should bedisplayed. The following values may be displayed:kbmemfreeAmount of free memory available in kilobytes.kbavailEstimate of how much memory in kilobytes is available for starting new applications, withoutswapping. The estimate takes into account that the system needs some page cache to functionwell, and that not all reclaimable slab will be reclaimable, due to items being in use. Theimpact of those factors will vary from system to system.kbmemusedAmount of used memory in kilobytes. This does not take into account memory used by the kernelitself.%memusedPercentage of used memory.kbbuffersAmount of memory used as buffers by the kernel in kilobytes.kbcachedAmount of memory used to cache data by the kernel in kilobytes.kbcommitAmount of memory in kilobytes needed for current workload. This is an estimate of how muchRAM/swap is needed to guarantee that there never is out of memory.%commitPercentage 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.kbactiveAmount of active memory in kilobytes (memory that has been used more recently and usually notreclaimed unless absolutely necessary).kbinactAmount of inactive memory in kilobytes (memory which has been less recently used. It is moreeligible to be reclaimed for other purposes).kbdirtyAmount of memory in kilobytes waiting to get written back to the disk.kbanonpgAmount of non-file backed pages in kilobytes mapped into userspace page tables.kbslabAmount of memory in kilobytes used by the kernel to cache data structures for its own use.kbkstackAmount of memory in kilobytes used for kernel stack space.kbpgtblAmount of memory in kilobytes dedicated to the lowest level of page tables.kbvmusedAmount of memory in kilobytes of used virtual address space.
sar -r ...
-s
Set the starting time of the data, causing the sar command to extract records time-tagged at, or fol‐lowing, the time specified. The default starting time is 08:00:00. Hours must be given in 24-hour for‐mat. This option can be used only when data are read from a file (option -f).
sar -s ...
-u
Report CPU utilization. The ALL keyword indicates that all the CPU fields should be displayed. Thereport may show the following fields:%userPercentage of CPU utilization that occurred while executing at the user level (application).Note that this field includes time spent running virtual processors.%usrPercentage of CPU utilization that occurred while executing at the user level (application).Note that this field does NOT include time spent running virtual processors.%nicePercentage of CPU utilization that occurred while executing at the user level with nice prior‐ity.%systemPercentage of CPU utilization that occurred while executing at the system level (kernel). Notethat this field includes time spent servicing hardware and software interrupts.%sysPercentage of CPU utilization that occurred while executing at the system level (kernel). Notethat this field does NOT include time spent servicing hardware or software interrupts.%iowaitPercentage of time that the CPU or CPUs were idle during which the system had an outstandingdisk I/O request.%stealPercentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor wasservicing another virtual processor.%irqPercentage of time spent by the CPU or CPUs to service hardware interrupts.%softPercentage of time spent by the CPU or CPUs to service software interrupts.%guestPercentage of time spent by the CPU or CPUs to run a virtual processor.%gnicePercentage of time spent by the CPU or CPUs to run a niced guest.%idlePercentage of time that the CPU or CPUs were idle and the system did not have an outstandingdisk I/O request.Note: On SMP machines a processor that does not have any activity at all (0.00 for every field) is adisabled (offline) processor.
sar -u ...
-V
Print version number then exit.
sar -V ...
-v
dentunusdNumber of unused cache entries in the directory cache.file-nrNumber of file handles used by the system.inode-nrNumber of inode handlers used by the system.pty-nrNumber of pseudo-terminals used by the system.
sar -v ...
-W
pswpin/sTotal number of swap pages the system brought in per second.pswpout/sTotal number of swap pages the system brought out per second.
sar -W ...
-w
proc/sTotal number of tasks created per second.cswch/sTotal number of context switches per second.
sar -w ...
-y
rcvin/sNumber of receive interrupts per second for current serial line. Serial line number is given inthe TTY column.xmtin/sNumber of transmit interrupts per second for current serial line.framerr/sNumber of frame errors per second for current serial line.prtyerr/sNumber of parity errors per second for current serial line.brk/sNumber of breaks per second for current serial line.ovrun/sNumber of overrun errors per second for current serial line.ENVIRONMENTThe sar command takes into account the following environment variables:S_COLORSWhen this variable is set, display statistics in color on the terminal. Possible values for this vari‐able are never, always or auto (the latter is the default).Please note that the color (being red, yellow, or some other color) used to display a value is notindicative of any kind of issue simply because of the color. It only indicates different ranges of val‐ues.S_COLORS_SGRSpecify the colors and other attributes used to display statistics on the terminal. Its value is acolon-separated list of capabilities that defaults toC=33;22:H=31;1:I=32;22:M=35;1:N=34;1:R=31;22:Z=34;22. Supported capabilities are:C= SGR (Select Graphic Rendition) substring for comments inserted in the binary daily data files.H= SGR substring for percentage values greater than or equal to 75%.I= SGR substring for item names or values (eg. network interfaces, CPU number...)M= SGR substring for percentage values in the range from 50% to 75%.N= SGR substring for non-zero statistics values.R= SGR substring for restart messages.Z= SGR substring for zero values.S_TIME_DEF_TIMEIf this variable exists and its value is UTC then sar will save its data in UTC time (data will stillbe displayed in local time). sar will also use UTC time instead of local time to determine the currentdaily data file located in the /var/log/sysstat directory. This variable may be useful for servers withusers located across several timezones.S_TIME_FORMATIf this variable exists and its value is ISO then the current locale will be ignored when printing thedate in the report header. The sar command will use the ISO 8601 format (YYYY-MM-DD) instead. Thetimestamp will also be compliant with ISO 8601 format.EXAMPLESsar -u 2 5Report CPU utilization for each 2 seconds. 5 lines are displayed.sar -I 14 -o int14.file 2 10Report statistics on IRQ 14 for each 2 seconds. 10 lines are displayed. Data are stored in a filecalled int14.file.sar -r -n DEV -f /var/log/sysstat/sa16Display memory and network statistics saved in daily data file 'sa16'.sar -ADisplay 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 youare using at least a 2.6 kernel.FILES/var/log/sysstat/saDD/var/log/sysstat/saYYYYMMDDThe standard system activity daily data files and their default location. YYYY stands for the currentyear, MM for the current month and DD for the current day./proc and /sys contain various files with system statistics.AUTHORSebastien Godard (sysstat <at> orange.fr)
sar -y ...