This article contains instructions or advice. (July 2023) |
sar | |
|---|---|
| Stable release | sysstat 12.7.6
/ July 3, 2024 |
| Written in | C |
| Operating system | AIX, Linux, Solaris, HP-UX |
| Type | System reporting |
| Website | sysstat |
| Repository | github |

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 /proc filesystem for gathering information.
Sar was originally developed for the Unix System V operating system; it is available in AIX, HP-UX, Solaris and other System V based operating systems but it is not available for macOS or FreeBSD. Prior to 2013 there was a bsdsar tool, but it is now deprecated.
Most Linux distributions provide sar utility through the sysstat package.
sar [-flags] [ -e time ] [ -f filename ] [-i sec ] [ -s time ]
[user@localhost]$ sar # Displays current CPU activity.
Additional to sar command, Linux sysstat package in Debian, RedHat Enterprise Linux and SuSE provides additional reporting tools:
sar, supporting the same flags as sar command which write a daily report in the /var/log/sa directory. – Linux Administration and Privileged Commands Manualsar 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.sag - system activity graph [...] DESCRIPTION sag graphically displays the system activity data stored in a binary data file by a previous sar(1) run.