sar (Unix)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Stable release
sysstat 11.6.4[1] / June 1, 2018; 2 months ago (2018-06-01)
Preview release
sysstat 11.7.4 / June 1, 2018; 2 months ago (2018-06-01) [2]
Written in C
Operating system AIX, Linux, Solaris, HP-UX
Type System reporting
Called regularly by cron, sadc does the monitoring and stores its measurements to files in the /var/log/sa/ folder. The sar client can be used to explore this data.

System Activity Report (sar) is a Unix System V-derived system monitor command used to report on various system loads, including CPU activity, memory/paging, interrupts, device load, network and swap space utilization. Sar uses /procfilesystem for gathering information [3]

Platform support[edit]

Sar was originally developed for Solaris operating system[4] and it is available in Linux, Solaris, AIX, HP-UX, but it is not available for MacOS or FreeBSD, until 2013 there was a bsdsar tool actually deprecated [5].

Linux distributions, such as Red Hat Enterprise Linux and SuSe[6] provide sar utility through the sysstat package.


sar [-flags] [ -e time ] [ -f filename ] [-i sec ] [ -s time ]
-f filename Uses filename as the data source for sar. The default is the current daily data file /var/adm/sa/sadd.
-e time Selects data up to time. The default is 18:00.
-i sec Selects data at intervals as close as possible to sec seconds.


[user@localhost]$ sar  # Displays current CPU activity.

Sysstat package[edit]

Additional to sar command, Linux sysstat package in Debian[7], RedHat Enterprise Linux and SuSE provides additional reporting tools:

  • sar [8], Collect, report, or save system activity information.
  • sa1 [9], Collect and store binary data in the system activity daily data file
  • sa2 [10], shell variant of sar, supporting the same flags as sar command which write a daily report in the /var/log/sa directory
  • sadf(1) [11], similar to sar but can write its data in different formats (CSV, XML, etc.). This is useful to load performance data into a database, or import them in a spreadsheet to make graphs.
  • iostat (1) reports basic CPU statistics and input/output statistics for devices, partitions and network filesystems.
  • mpstat(1) reports individual or combined processor related statistics.
  • pidstat(1) reports statistics for Linux tasks (processes) : I/O, CPU, memory, etc.
  • nfsiostat(1) reports input/output statistics for network filesystems (NFS).
  • cifsiostat(1) reports I/O statistics for CIFS resources.

See also[edit]

  • atopsar
  • Nmon
  • sag - "system activity graph" command[12]
  • ksar- BSD licensed Java-based application to create graph of all parameters from the data collected by Unix sar utilities.
  • CURT, IBM AIX CPU Usage Reporting Tool
  • isag, tcl based command to plot sar/sysstat data