sa1
Collect and store system activity information
SYNOPSIS
sa1 [ options ] [ interval [ count ] ]
PARAMETERS
-S {keyword[,...]|ALL}
Specify the metrics to collect. Keywords include CPU, DISK, IPV6, MEM, NET, POWER, PRES, SCSI, SNMP, USB, or ALL for all available statistics. Multiple keywords can be comma-separated.
-U
Do not update the current daily activity file. This option is primarily useful when sa1 is invoked manually from a shell prompt for debugging or one-off collection purposes.
-V
Display version number and exit.
interval
The time interval (in seconds) between two samples. If omitted, sa1 collects a single sample. When used in cron jobs, this typically aligns with the cron interval.
count
The number of samples to collect. If omitted, sa1 collects samples indefinitely (when interval is specified) or just one (when interval is also omitted).
DESCRIPTION
The sa1 command is an essential component of the sysstat package, designed for collecting and saving daily system activity data. It acts as a data gatherer, typically invoked periodically by a cron job (e.g., every 10 minutes) to record various system metrics. These metrics include CPU utilization, memory usage, I/O activity, network statistics, and much more.
sa1 writes the collected data in a compact, binary format to a daily activity file, usually located in /var/log/sysstat/. The filename typically follows the pattern saDD, where DD represents the day of the month. This binary data serves as the source for the sar (System Activity Report) command, which can then display historical system performance information in a human-readable format. By continuously collecting data, sa1 enables system administrators to analyze trends, identify performance bottlenecks, and troubleshoot issues over time. It's a foundational tool for proactive system monitoring.
CAVEATS
sa1 generates binary data files that are not human-readable directly; they must be parsed and displayed by the sar command. It relies on being regularly invoked, typically by a cron job, to maintain continuous system activity records. Disk space usage for historical data can accumulate over time if old saDD files are not regularly purged, which is usually handled by sa2 or similar scripts. The default collection interval and scope are often configured in the sysstat package's configuration files (e.g., /etc/default/sysstat or /etc/sysconfig/sysstat).
CONFIGURATION FILES
The behavior of sa1 and the sysstat package is often controlled by configuration files such as /etc/default/sysstat or /etc/sysconfig/sysstat (depending on the Linux distribution). These files typically define variables like HISTORY (number of days to keep data), COLLECT_INTERVAL (default interval for sa1), and SA_DIR (directory for data files, usually /var/log/sysstat/).
DATA FILE LOCATION
Collected data is stored in binary files, typically in /var/log/sysstat/. Filenames follow the pattern saDD, where DD is the day of the month (e.g., sa01 for the first day, sa15 for the fifteenth). These files are then read by sar to generate human-readable reports.
HISTORY
sa1 is an integral part of the sysstat utility suite, which has been a staple in Linux and Unix-like operating systems for performance monitoring for many years. Developed and maintained by Sebastien Godard, sysstat provides a comprehensive set of tools for system activity reporting. sa1's role as the primary data collector has remained consistent, facilitating the long-term analysis of system performance trends. Its reliance on cron for periodic execution reflects a robust and automated approach to system data gathering, a design philosophy that has persisted since its early development.