LinuxCommandLibrary

sadc

Collect system activity data

SYNOPSIS

sadc [ options ] [ interval [ count ] ] [ output_file ]

PARAMETERS

interval
    The amount of time in seconds between two consecutive data collections.

count
    The number of data collections to be made. If omitted, data is collected indefinitely until termination.

output_file
    The path to the file where the collected binary system activity data will be saved. If omitted, data is written to standard output.

-F
    Display the file header and the data collected from the input file in a human-readable format. This option is useful for debugging sadc data files.

-L
    Store statistics in a local file. This option is typically used by the sa1 script to specify a local output file.

-S {keyword[,...]|ALL}
    Specifies which system activity units are to be saved. For example, 'CPU,DISK' to save only CPU and disk statistics. Use 'ALL' to save all available units.

-C {keyword[,...]|ALL}
    Specifies which system activity units are to be read from the input file. This is used when processing an existing sadc file for analysis or manipulation, similar to sar's data selection.

DESCRIPTION

sadc (System Activity Data Collector) is a fundamental component of the sysstat package, designed to gather comprehensive system activity data. It collects various performance metrics such as CPU utilization, memory usage, I/O statistics, network activity, process information, and more. Unlike other sysstat tools like sar or iostat that display real-time or historical data, sadc's primary role is to act as a backend data collector. It writes this raw, binary data to a specified file, typically located in /var/log/sa/. This binary format is highly efficient for storage. The collected data can then be processed and analyzed by other tools, most notably sar, which can read these files and present the information in a human-readable format, either for historical analysis or real-time monitoring (when sar acts as both collector and reporter). sadc is usually invoked automatically by the sa1 script, which is often configured to run periodically via cron jobs, ensuring continuous system monitoring without manual intervention.

CAVEATS

The output file generated by sadc is in a binary format and is not directly human-readable; it requires tools like sar to parse and display its contents. sadc often requires root privileges to collect comprehensive system activity data. It is typically not invoked directly by users but rather by the sa1 script as part of automated cron jobs for continuous system monitoring.

TYPICAL USAGE WITH <I>CRON</I>

sadc is rarely run directly by users. Instead, it's usually invoked by the sa1 script, which is part of the sysstat utilities. The sa1 script itself is typically scheduled to run at regular intervals (e.g., every 10 minutes) via cron. This automated setup ensures continuous collection of system performance data without manual intervention, saving it to files in /var/log/sa/ (e.g., saDD or saYYYYMMDD). These daily files form a historical record that can be analyzed later using sar.

HISTORY

sadc is an integral part of the sysstat package, a suite of performance monitoring tools that have been a cornerstone of Linux system administration for many years. Its development has mirrored the evolution of Linux kernels, continuously adding support for new metrics and system architectures, making it a reliable and robust tool for historical performance analysis.

SEE ALSO

sar(1), sa1(8), sa2(8), iostat(1), mpstat(1), pidstat(1), vmstat(8)

Copied to clipboard