LinuxCommandLibrary

sa1

Collect and store system activity information

SYNOPSIS

sa1 [ interval [ count ] ]

PARAMETERS

interval
    The sampling interval in seconds. If omitted, the default is 1 second.

count
    The number of samples to take. If omitted, sa1 runs indefinitely.

DESCRIPTION

The sa1 command is a crucial component of the sysstat utilities, used to collect and store system activity information. It's typically invoked by a cron job to periodically sample data like CPU utilization, memory usage, disk I/O, and network activity. The collected data is then stored in binary files, which can be analyzed using other sysstat tools like sar (System Activity Reporter). Sa1's main function is to write raw system performance metrics to disk for historical analysis. Without sa1 running regularly, you will not be able to collect historical data with sar. This facilitates capacity planning, performance tuning, and troubleshooting. It acts as a data collector, providing the raw material for more in-depth performance analysis. The typical invocation is scheduled every ten minutes to hourly and the results written to /var/log/sa/saDD files.

CAVEATS

sa1's primary function is data collection. You need sar to generate human-readable reports from the collected data. The data files created by sa1 are in a binary format specific to the sysstat tools.

USAGE

Typically, sa1 is invoked from a cron job. For example, to collect data every 10 minutes, you might add a line like this to your crontab:
*/10 * * * * /usr/lib64/sa/sa1 1 1
This will run sa1 every 10 minutes, taking one sample at a 1-second interval and append the output to a daily data file. The path `/usr/lib64/sa/sa1` may vary depending on distribution.

DATA STORAGE

The data collected by sa1 is stored in binary files in the /var/log/sa directory (or similar, depending on your distribution). The files are named saDD, where DD is the day of the month. You typically don't access these files directly; instead, you use sar to generate reports from them.

RELATION TO SADC

sa1 is often a symbolic link to the sadc command, or a shell script wrapper calling sadc. sadc is the actual program doing the data collection. sa1 is simply a convenient way to invoke sadc with the appropriate parameters.

HISTORY

sa1 is part of the sysstat package, which has been a standard tool for system monitoring on Linux and Unix-like systems for many years. It evolved to provide a reliable and consistent way to collect system activity data for performance analysis and capacity planning. Its continued usage is due to its simplicity and low resource consumption while providing a wealth of data.

SEE ALSO

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

Copied to clipboard