LinuxCommandLibrary

sadc

Collect system activity data

SYNOPSIS

sadc [ -F ] [ -H ] [ -V ] [ -S keyword[,...] ] [ -T directory ] [ interval [ count ] ] [ outfile ]

PARAMETERS

-F
    Force the creation of the output file, even if it already exists. This overwrites any previous data in the file.

-H
    Display the usage help message and exit.

-S keyword[,...]
    Report only selected activities specified by keyword(s). Refer to the `sar` man page for a list of valid keywords. Keywords are comma separated.

-T directory
    Set the temporary directory to store data. Default is /tmp.

interval
    Sampling interval in seconds. If not specified, `sadc` runs only once.

count
    Number of times data is collected. If not specified and interval is provided, `sadc` runs continuously.

outfile
    Output file where the collected data is stored. If not specified, output is written to standard output.

-V
    Print version number then exit.

DESCRIPTION

The `sadc` command is the system activity data collector. It is used by `sar` to collect and save system activity information. `sadc` retrieves data about CPU usage, memory, disk I/O, network activity, and other system metrics. This data is then stored in binary files for later analysis by `sar`. Typically, `sadc` is automatically run periodically via cron or systemd timers. It is essential for monitoring system performance over time and diagnosing performance issues.

Without any options, `sadc` reads the standard system activity counters and writes them in binary form to standard output. It can also be used to write the collected data to a specified file. The interval and number of iterations control how often the data is collected and for how long. It is recommended to run `sadc` at regular intervals to maintain a historical record of system performance. Its primary purpose is to enable offline analysis using the `sar` command. `sadc` is an integral component of the `sysstat` package, which provides a comprehensive suite of system performance monitoring tools.

CAVEATS

Data files created by `sadc` are in a binary format specific to the `sysstat` package. They cannot be easily read or interpreted without `sar` or other tools designed for this format. The accuracy of the data collected depends on the sampling interval. Too short an interval can impact system performance, while too long an interval may miss important transient events.

SIGNALS

Sending a `SIGUSR1` signal to the running `sadc` process will cause it to close the current data file and create a new one. This can be useful for managing data file sizes or for marking specific points in time in the data.

PERMISSIONS

Normally, `sadc` needs root privileges to read system activity counters and write the data to a file. Running `sadc` without proper permissions may result in incomplete or inaccurate data.

HISTORY

The `sadc` command is part of the `sysstat` package, which has been developed and maintained for many years. It has evolved to support new hardware and system metrics as they have become available. The initial versions focused on basic CPU and memory usage, while later versions added support for disk I/O, network activity, and other system resources. `sadc` is designed to be a low-overhead data collector, making it suitable for continuous monitoring in production environments. It is widely used for capacity planning, performance analysis, and troubleshooting system issues.

SEE ALSO

sar(1), sysstat(1)

Copied to clipboard