1SADC(8)                       Linux User's Manual                      SADC(8)
2
3
4

NAME

6       sadc - System activity data collector.
7
8

SYNOPSIS

10       /usr/lib64/sa/sadc  [ -C comment ] [ -D ] [ -F ] [ -f ] [ -L ] [ -V ] [
11       -S { keyword[,...] | ALL | XALL } ] [ interval [ count ] ] [ outfile ]
12
13

DESCRIPTION

15       The sadc command samples  system  data  a  specified  number  of  times
16       (count)  at  a  specified  interval measured in seconds (interval).  It
17       writes in binary format to the specified outfile or to standard output.
18       If  outfile  is  set  to -, then sadc uses the standard system activity
19       daily data file (see below).  In this case, if the file already exists,
20       sadc  will overwrite it if it is from a previous month. By default sadc
21       collects most of the data available from the  kernel.   But  there  are
22       also  optional  metrics, for which the relevant options must be explic‐
23       itly passed to sadc to be collected (see option -S below).
24
25       The standard system activity daily data file is named saDD  unless  op‐
26       tion  -D  is  used,  in  which  case its name is saYYYYMMDD, where YYYY
27       stands for the current year, MM for the current month and  DD  for  the
28       current day. By default it is located in the /var/log/sa directory. Yet
29       it is possible to specify an alternate location for it: If outfile is a
30       directory  (instead  of a plain file) then it will be considered as the
31       directory where the standard system activity daily data  file  will  be
32       saved.
33
34       When  the  count  parameter is not specified, sadc writes its data end‐
35       lessly. When both interval and count are not specified, and  option  -C
36       is  not  used,  a dummy record, which is used at system startup to mark
37       the time when the counter restarts from 0, will be written.  For  exam‐
38       ple, one of the system startup script may write the restart mark to the
39       daily data file by the command entry:
40
41       /usr/lib64/sa/sadc -
42
43       The sadc command is intended to be used as a backend to  the  sar  com‐
44       mand.
45
46       Note: The sadc command only reports on local activities.
47
48

OPTIONS

50       -C comment
51              When  neither  the  interval nor the count parameters are speci‐
52              fied, this option tells sadc to write a dummy record  containing
53              the specified comment string. This comment can then be displayed
54              with option -C of sar.
55
56       -D     Use saYYYYMMDD instead of saDD as the standard  system  activity
57              daily data file name.
58
59       -F     The  creation of outfile will be forced. If the file already ex‐
60              ists and has a format unknown to sadc then it will be truncated.
61              This may be useful for daily data files created by an older ver‐
62              sion of sadc and whose format is no longer compatible with  cur‐
63              rent one.
64
65       -f     fdatasync() will be used to ensure data is written to disk. This
66              differs from the normal operation in that a sudden system  reset
67              is  less likely to result in the saDD datafiles being corrupted.
68              However, this is at the expense of performance within  the  sadc
69              process  as forward progress will be blocked while data is writ‐
70              ten to underlying disk instead of just to cache.
71
72       -L     sadc will try to get an exclusive lock  on  the  outfile  before
73              writing  to  it or truncating it. Failure to get the lock is fa‐
74              tal, except in the case of trying to write a normal (i.e. not  a
75              dummy  and  not  a  header) record to an existing file, in which
76              case sadc will try again at the next interval. Usually, the only
77              reason  a  lock would fail would be if another sadc process were
78              also writing to the file. This can happen when cron is  used  to
79              launch  sadc.  If  the  system  is under heavy load, an old sadc
80              might still be running when cron starts a new one. Without lock‐
81              ing,  this  situation  can result in a corrupted system activity
82              file.
83
84       -S { keyword[,...] | ALL | XALL }
85              Possible keywords are DISK, INT, IPV6, POWER, SNMP,  XDISK,  ALL
86              and XALL.
87              Specify  which  optional activities should be collected by sadc.
88              Some activities are optional to prevent data files from  growing
89              too  large.  The DISK keyword indicates that sadc should collect
90              data for block devices. The  INT  keyword  indicates  that  sadc
91              should  collect data for system interrupts. The IPV6 keyword in‐
92              dicates that IPv6 statistics should be collected  by  sadc.  The
93              POWER  keyword  indicates that sadc should collect power manage‐
94              ment statistics. The SNMP keyword indicates that SNMP statistics
95              should  be  collected  by sadc. The ALL keyword is equivalent to
96              specifying all the keywords above and therefore all previous ac‐
97              tivities are collected.
98
99              The  XDISK keyword is an extension to the DISK one and indicates
100              that partitions and filesystems statistics should  be  collected
101              by  sadc  in addition to disk statistics. This option works only
102              with kernels 2.6.25 and later. The XALL keyword is equivalent to
103              specifying all the keywords above (including keyword extensions)
104              and therefore all possible activities are collected.
105
106              Important note: The activities (including optional  ones)  saved
107              in an existing data file prevail over those selected with option
108              -S.  As a consequence, appending data to an existing  data  file
109              will result in option -S being ignored.
110
111       -V     Print version number then exit.
112
113

ENVIRONMENT

115       The sadc command takes into account the following environment variable:
116
117       S_TIME_DEF_TIME
118              If this variable exists and its value is UTC then sadc will save
119              its data in UTC time.  sadc will also use UTC  time  instead  of
120              local  time  to determine the current daily data file located in
121              the /var/log/sa directory.
122
123

EXAMPLES

125       /usr/lib64/sa/sadc 1 10 /tmp/datafile
126              Write 10 records of one second intervals  to  the  /tmp/datafile
127              binary file.
128
129       /usr/lib64/sa/sadc -C "Backup Start" /tmp/datafile
130              Insert the comment "Backup Start" into the file /tmp/datafile.
131
132

BUGS

134       The /proc filesystem must be mounted for the sadc command to work.
135
136       All the statistics are not necessarily available, depending on the ker‐
137       nel version used.  sadc assumes that you are using at least a 2.6  ker‐
138       nel.
139
140

FILES

142       /var/log/sa/saDD
143       /var/log/sa/saYYYYMMDD
144              The  standard system activity daily data files and their default
145              location.  YYYY stands for the current year, MM for the  current
146              month and DD for the current day.
147       /proc and /sys contain various files with system statistics.
148
149

AUTHOR

151       Sebastien Godard (sysstat <at> orange.fr)
152
153

SEE ALSO

155       sar(1), sa1(8), sa2(8), sadf(1), sysstat(5)
156
157       https://github.com/sysstat/sysstat
158       http://pagesperso-orange.fr/sebastien.godard/
159
160
161
162Linux                              JULY 2020                           SADC(8)
Impressum