Sar (Unix)

Last updated
sar
Stable release
sysstat 12.1.1 [1] / October 13, 2018;4 years ago (2018-10-13)
Preview release
sysstat 11.7.4 / June 1, 2018;4 years ago (2018-06-01) [2]
Repository github.com/sysstat/sysstat/
Written inC
Operating system AIX, Linux, Solaris, HP-UX
Type System reporting
Website sebastien.godard.pagesperso-orange.fr//
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. Sysstat tools sadc and sar.svg
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 /proc filesystem for gathering information. [3]

Contents

Platform support

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. [4]

Most Linux distributions provide sar utility through the sysstat package.

Syntax

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.

Example

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

Sysstat package

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

See also

Related Research Articles

Linux has several filesystem drivers for the File Allocation Table (FAT) filesystem format. These are commonly known by the names used in the mount command to invoke particular drivers in the kernel: msdos, vfat, and umsdos.

<span class="mw-page-title-main">Load (computing)</span> Amount of computational work that a computer system performs

In UNIX computing, the system load is a measure of the amount of computational work that a computer system performs. The load average represents the average system load over a period of time. It conventionally appears in the form of three numbers which represent the system load during the last one-, five-, and fifteen-minute periods.

The Filesystem Hierarchy Standard (FHS) is a reference describing the conventions used for the layout of a UNIX system. It has been made popular by its use in Linux distributions, but it is used by other UNIX variants as well. It is maintained by the Linux Foundation. The latest version is 3.0, released on 3 June 2015.

tmpfs is a temporary file storage paradigm implemented in many Unix-like operating systems. It is intended to appear as a mounted file system, but data is stored in volatile memory instead of a persistent storage device. A similar construction is a RAM disk, which appears as a virtual disk drive and hosts a disk file system.

The archiver, also known simply as ar, is a Unix utility that maintains groups of files as a single archive file. Today, ar is generally used only to create and update static library files that the link editor or linker uses and for generating .deb packages for the Debian family; it can be used to create archives for any purpose, but has been largely replaced by tar for purposes other than static libraries. An implementation of ar is included as one of the GNU Binutils.

top (software) Task manager program found in many Unix-like operating systems

top is a task manager program, found in many Unix-like operating systems, that displays information about CPU and memory utilization.

wc (Unix) Unix command utility

wc is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. The program reads either standard input or a list of computer files and generates one or more of the following statistics: newline count, word count, and byte count. If a list of files is provided, both individual file and total statistics follow.

fstab is a system file commonly found in the directory /etc on Unix and Unix-like computer systems. In Linux, it is part of the util-linux package. The fstab file typically lists all available disk partitions and other types of file systems and data sources that may not necessarily be disk-based, and indicates how they are to be initialized or otherwise integrated into the larger file system structure.

stat (system call) Unix system call

stat is a Unix system call that returns file attributes about an inode. The semantics of stat vary between operating systems. As an example, Unix command ls uses this system call to retrieve information on files that includes:

mv is a Unix command that moves one or more files or directories from one place to another. If both filenames are on the same filesystem, this results in a simple file rename; otherwise the file content is copied to the new location and the old file is removed. Using mv requires the user to have write permission for the directories the file will move between. This is because mv changes the content of both directories involved in the move. When using the mv command on files located on the same filesystem, the file's timestamp is not updated.

file (command) Standard Unix program

The file command is a standard program of Unix and Unix-like operating systems for recognizing the type of data contained in a computer file.

The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory. Typically, it is mapped to a mount point named /proc at boot time. The proc file system acts as an interface to internal data structures about running processes in the kernel. In Linux, it can also be used to obtain information about the kernel and to change certain kernel parameters at runtime (sysctl).

File attributes are a type of meta-data that describe and may modify how files and/or directories in a filesystem behave. Typical file attributes may, for example, indicate or specify whether a file is visible, modifiable, compressed, or encrypted. The availability of most file attributes depends on support by the underlying filesystem where attribute data must be stored along with other control structures. Each attribute can have one of two states: set and cleared. Attributes are considered distinct from other metadata, such as dates and times, filename extensions or file system permissions. In addition to files, folders, volumes and other file system objects may have attributes.

tail is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data.

In computing, a dynamic linker is the part of an operating system that loads and links the shared libraries needed by an executable when it is executed, by copying the content of libraries from persistent storage to RAM, filling jump tables and relocating pointers. The specific operating system and executable format determine how the dynamic linker functions and how it is implemented.

vmstat is a computer system monitoring tool that collects and displays summary information about operating system memory, processes, interrupts, paging and block I/O. Users of vmstat can specify a sampling interval which permits observing system activity in near-real time.

iostat

iostat is a computer system monitor tool used to collect and show operating system storage input and output statistics. It is often used to identify performance issues with storage devices, including local disks, or remote disks accessed over network file systems such as NFS. It can also be used to provide information about terminal (TTY) input and output, and also includes some basic CPU information.

chattr is the command in Linux that allows a user to set certain attributes of a file. lsattr is the command that displays the attributes of a file.

Ksar is a BSD-licensed Java-based application that creates graphs of all parameters from data collected by Unix sar utilities. Usually, Unix sar is part of Unix' Sysstat package, and runs sa1, sa2, and sadc through cron to created data files in /var/log/sa/saNN. Characteristics include:

sysstat is a collection of performance monitoring tools for Linux. It is available on Unix and Unix-like operating systems.

References

Footnotes

  1. "Release v12.1.1: Sysstat-12.1.1 · sysstat/Sysstat". GitHub .
  2. "SYSSTAT". sebastien.godard.pagesperso-orange.fr.
  3. "SYSSTAT". sebastien.godard.pagesperso-orange.fr.
  4. "FreshPorts -- sysutils/bsdsar: System Activity Reporter for FreeBSD". www.freshports.org.
  5. "Debian -- Details of package sysstat in sid". packages.debian.org.
  6. "sag(1)" (PDF). SUNOS Reference Manual. Mountain View, California: Sun Microsystems. 1993-02-24. pp. 1–895. Retrieved 2010-05-04. sag - system activity graph [...] DESCRIPTION sag graphically displays the system activity data stored in a binary data file by a previous sar(1) run.