LinuxCommandLibrary

sa2

Collect, report, and save system activity

SYNOPSIS

sa2 [ options ] [ DD ]

PARAMETERS

-A
    Displays all available activities for the day, equivalent to specifying all report options.

-u
    Reports CPU utilization statistics, including user, nice, system, iowait, steal, and idle percentages.

-r
    Reports memory utilization statistics, including free, used, buffered, cached memory, and swap space usage.

-b
    Reports I/O and transfer rate statistics for block devices, including total and average transfer rates.

-d
    Reports individual block device I/O statistics, showing per-device activity.

-n DEV
    Reports network statistics for network interfaces (e.g., Rx/Tx packets, errors, collisions). Other network keywords like EDEV, NFS, NFSD, SOCK, IP, EIP, ICMP, EICMP, TCP, ETCP, UDP, SOCK6, IP6, EIP6, ICMP6, EICMP6, UDP6, ALL can be used.

-s HH:MM:SS
    Sets the starting time of the report. The default is 00:00:00 (midnight).

-e HH:MM:SS
    Sets the ending time of the report. The default is 23:59:59 (end of day).

-i interval
    Sets the interval (in seconds) between each sample displayed in the report. This option affects how many samples are displayed, not how often data is collected.

DD
    Specifies the day of the month (1-31) for which to display the report. If omitted, the current day is assumed, and sa2 automatically selects the corresponding /var/log/sa/saDD file.

DESCRIPTION

sa2 is a command-line utility used to display comprehensive daily system activity reports. It acts as a wrapper or a convenience script around the sar(1) command, specifically configured to read data collected by the sadc daemon for the current or a specified day. The data is typically stored in binary files like /var/log/sa/saDD, where DD represents the day of the month.

Its primary purpose is to simplify the retrieval and presentation of historical system performance metrics without needing to manually specify the data file. sa2 can show various system statistics, including CPU utilization, memory usage, I/O activity, network statistics, and more, aggregated over a 24-hour period. This makes it an invaluable tool for system administrators and performance analysts to review daily trends, identify potential bottlenecks, and diagnose intermittent issues.

CAVEATS

sa2 relies on the sysstat package being installed and properly configured, specifically that the sadc data collector runs periodically (e.g., via cron) to generate the daily activity files in /var/log/sa/. If these files are not present or are incomplete, sa2 will display no data or incomplete reports.

The exact implementation and availability of the sa2 command may vary between Linux distributions. Some distributions may not provide sa2 as a direct command, instead expecting users to invoke sar directly with the appropriate -f option for daily files.

<B>DATA SOURCE</B>

sa2 reads its data from daily activity files, typically named /var/log/sa/saDD (where DD is the day of the month), which are generated by the sadc data collector. These binary files contain snapshots of system activity taken at regular intervals, usually by a cron job running sa1.

<B>CONVENIENCE WRAPPER</B>

While the same information can be obtained directly using the sar command with the -f option (e.g., sar -A -f /var/log/sa/sa25), sa2 simplifies this process by automatically inferring the data file based on the current date or a specified day of the month, making it quicker and easier to review daily performance logs. Options passed to sa2 are generally passed directly to the underlying sar command.

HISTORY

The sa2 command is an integral part of the sysstat utilities, a comprehensive collection of performance monitoring tools for Linux. The sysstat package was developed by Sébastien Godard. sa2 (along with sa1) was introduced to simplify the automation and viewing of daily system activity reports, building upon the core functionality of sar and sadc. Its design facilitates easy access to historical performance data without requiring users to remember the specific file paths or complex sar syntax for daily reports.

SEE ALSO

sar(1), sadc(8), sa1(8), sysstat(5)

Copied to clipboard