In order to get the most of the
sysstat package, one should look through various system statistics (and corresponding command line switches to query it). This type of details can be easily obtained from
Instead of data query switches, this article focuses on interaction between the components from
sysstat package as well as where the data comes from and goes to.
sysstat is used to monitor various system performance indicators on the system.
Understanding relationships between all components makes things clearer:
- The default binary
/var/log/sa/sa##data files contain the measurement history (
##is day of month).
- The human readable
/var/log/sa/sar##report files contain daily reports (
##is day of month).
- Reporting tool
sarto generate reports based on data files. It can also be used as interactive tool.
- Reporting tool
sadfwhich in combination with
sargenerates reports using various formats.
- Data collector
sadcto maintain the measurement history in data files. According to its
sadcis backend used by
cronjobs defined in
sa1script calls data collector
sadcto save periodic measurements in data files. The
sarto produce daily reports in report files.
- A set of
*statcommands to interactively examine current system statistics (
pidstat) using no historical data. Command
sarcan also be used interactively.
sysstat init script simply creates initial measurement snapshot on boot. The package does not have a daemon. Data collection relies on
cron jobs only.
Interactive tools are supplementary to the standard system tool set - they are not related to reporting based on historical data. The
cron job and scripts are simply the way to prepare historical data. The key feature is reporting itself and corresponding
According to official FAQ , the measurements reported by
sar are average values based on differences in kernel counters on the given time interval. Kernel counters are cumulative since the system boot. The first report produced by
sar is generated for the time since system boot.
There are two configuration files:
/etc/sysconfig/sysstatis simple configuration file which concerns only data archiving.
/etc/sysconfig/sysstat.ioconffile guides data collection from devices detected and listed in
/proc/diskstats filesfiles. It is not changed normally.
sar command displays reports which require measurement data as a source. Measurement data may be obtained from prepared data files or from snapshots of current system statistic collected interactively.
Using current system statistic collected interactively
interval parameter is specified in seconds, it uses current system data producing measurements periodically as snapshots. Optional
count parameter limits number of snapshots.
sar 2 sar 2 5
Saving current system statistic for later use
-o specifies destination file name to save snapshots of system statistics so that the same file can be used to subsequently generate other reports with different requested information.
sar 2 5 -o output.data
As soon as measurement data has been collected, the same report can be produced instantly by specifying the same data file using
sar -f output.data
sar command saves the whole snapshot with measurements. Different information can be requested based on the same measurement data. For example, option
-A request almost all information in report:
sar -A -f output.data
Default data files
interval parameter and no
-f option with source data file are specified,
sar generates report based on default historical data (from default
/var/log/sa/sa## file) for current date.
Note that if
-o is given without file name,
sar still writes snapshots to the default
/var/log/sa/sa## data file regardless of the requested values in the report. It means that this data will be part of measurement history in addition to data generated periodically through the