SADC(8) | Linux User's Manual | SADC(8) |
sadc - System activity data collector.
/usr/lib/sysstat/sadc [ -C comment ] [ -D ] [ -F ] [ -L ] [ -V ] [ -S { keyword [,...] | ALL | XALL } ] [ interval [ count ] ] [ outfile ]
The sadc command samples system data a specified number of times (count) at a specified interval measured in seconds (interval). It writes in binary format to the specified outfile or to standard output. If outfile is set to -, then sadc uses the standard system activity daily data file (see below). In this case, if the file already exists, sadc will overwrite it if it is from a previous month. By default sadc collects most of the data available from the kernel. But there are also optional metrics, for which the relevant options must be explicitly passed to sadc to be collected (see option -S below).
The standard system activity daily data file is named saDD unless option -D is used, in which case its name is saYYYYMMDD, where YYYY stands for the current year, MM for the current month and DD for the current day. By default it is located in the /var/log/sysstat directory. Yet it is possible to specify an alternate location for it: If outfile is a directory (instead of a plain file) then it will be considered as the directory where the standard system activity daily data file will be saved.
When the count parameter is not specified, sadc writes its data endlessly. When both interval and count are not specified, and option -C is not used, a dummy record, which is used at system startup to mark the time when the counter restarts from 0, will be written. For example, one of the system startup script may write the restart mark to the daily data file by the command entry:
/usr/lib/sysstat/sadc -
The sadc command is intended to be used as a backend to the sar command.
Note: The sadc command only reports on local activities.
Specify which optional activities should be collected by sadc. Some activities are optional to prevent data files from growing too large. The DISK keyword indicates that sadc should collect data for block devices. The INT keyword indicates that sadc should collect data for system interrupts. The IPV6 keyword indicates that IPv6 statistics should be collected by sadc. The POWER keyword indicates that sadc should collect power management statistics. The SNMP keyword indicates that SNMP statistics should be collected by sadc. The ALL keyword is equivalent to specifying all the keywords above and therefore all previous activities are collected.
The XDISK keyword is an extension to the DISK one and indicates that partitions and filesystems statistics should be collected by sadc in addition to disk statistics. This option works only with kernels 2.6.25 and later. The XALL keyword is equivalent to specifying all the keywords above (including keyword extensions) and therefore all possible activities are collected.
Important note: The activities (including optional ones) saved in an existing data file prevail over those selected with option -S. As a consequence, appending data to an existing data file will result in option -S being ignored.
The sadc command takes into account the following environment variable:
/usr/lib/sysstat/sadc 1 10 /tmp/datafile
/usr/lib/sysstat/sadc -C Backup_Start /tmp/datafile
The /proc filesystem must be mounted for the sadc command to work.
All the statistics are not necessarily available, depending on the kernel version used. sadc assumes that you are using at least a 2.6 kernel.
/var/log/sysstat/saDD
/var/log/sysstat/saYYYYMMDD
Sebastien Godard (sysstat <at> orange.fr)
sar(1), sa1(8), sa2(8), sadf(1), sysstat(5)
https://github.com/sysstat/sysstat
http://pagesperso-orange.fr/sebastien.godard/
JULY 2018 | Linux |