1SADC(8) Linux User's Manual SADC(8)
2
3
4
6 sadc - System activity data collector.
7
9 /usr/lib64/sa/sadc [ -C comment ] [ -D ] [ -F ] [ -f ] [ -L ] [ -V ] [
10 -S { keyword [,...] | ALL | XALL } ] [ interval [ count ] ] [ outfile ]
11
13 The sadc command samples system data a specified number of times
14 (count) at a specified interval measured in seconds (interval). It
15 writes in binary format to the specified outfile or to standard output.
16 If outfile is set to -, then sadc uses the standard system activity
17 daily data file (see below). In this case, if the file already exists,
18 sadc will overwrite it if it is from a previous month. By default sadc
19 collects most of the data available from the kernel. But there are
20 also optional metrics, for which the relevant options must be explic‐
21 itly passed to sadc to be collected (see option -S below).
22
23 The standard system activity daily data file is named saDD unless
24 option -D is used, in which case its name is saYYYYMMDD, where YYYY
25 stands for the current year, MM for the current month and DD for the
26 current day. By default it is located in the /var/log/sa directory.
27 Yet it is possible to specify an alternate location for it: If outfile
28 is a directory (instead of a plain file) then it will be considered as
29 the directory where the standard system activity daily data file will
30 be saved.
31
32 When the count parameter is not specified, sadc writes its data end‐
33 lessly. When both interval and count are not specified, and option -C
34 is not used, a dummy record, which is used at system startup to mark
35 the time when the counter restarts from 0, will be written. For exam‐
36 ple, one of the system startup script may write the restart mark to the
37 daily data file by the command entry:
38
39 /usr/lib64/sa/sadc -
40
41 The sadc command is intended to be used as a backend to the sar com‐
42 mand.
43
44 Note: The sadc command only reports on local activities.
45
46
48 -C comment
49 When neither the interval nor the count parameters are speci‐
50 fied, this option tells sadc to write a dummy record containing
51 the specified comment string. This comment can then be dis‐
52 played with option -C of sar.
53
54 -D Use saYYYYMMDD instead of saDD as the standard system activity
55 daily data file name.
56
57 -F The creation of outfile will be forced. If the file already
58 exists and has a format unknown to sadc then it will be trun‐
59 cated. This may be useful for daily data files created by an
60 older version of sadc and whose format is no longer compatible
61 with current one.
62
63 -f fdatasync() will be used to ensure data is written to disk. This
64 differs from the normal operation in that a sudden system reset
65 is less likely to result in the saDD datafiles being corrupted.
66 However, this is at the expense of performance within the sadc
67 process as forward progress will be blocked while data is writ‐
68 ten to underlying disk instead of just to cache.
69
70 -L sadc will try to get an exclusive lock on the outfile before
71 writing to it or truncating it. Failure to get the lock is
72 fatal, except in the case of trying to write a normal (i.e. not
73 a dummy and not a header) record to an existing file, in which
74 case sadc will try again at the next interval. Usually, the only
75 reason a lock would fail would be if another sadc process were
76 also writing to the file. This can happen when cron is used to
77 launch sadc. If the system is under heavy load, an old sadc
78 might still be running when cron starts a new one. Without lock‐
79 ing, this situation can result in a corrupted system activity
80 file.
81
82 -S { keyword [,...] | ALL | XALL }
83 Possible keywords are DISK, INT, IPV6, POWER, SNMP, XDISK, ALL,
84 and XALL.
85
86 Specify which optional activities should be collected by sadc.
87 Some activities are optional to prevent data files from growing
88 too large. The DISK keyword indicates that sadc should collect
89 data for block devices. The INT keyword indicates that sadc
90 should collect data for system interrupts. The IPV6 keyword
91 indicates that IPv6 statistics should be collected by sadc. The
92 POWER keyword indicates that sadc should collect power manage‐
93 ment statistics. The SNMP keyword indicates that SNMP statis‐
94 tics should be collected by sadc. The ALL keyword is equivalent
95 to specifying all the keywords above and therefore all previous
96 activities are collected.
97
98 The XDISK keyword is an extension to the DISK one and indicates
99 that partitions and filesystems statistics should be collected
100 by sadc in addition to disk statistics. This option works only
101 with kernels 2.6.25 and later. The XALL keyword is equivalent
102 to specifying all the keywords above (including keyword exten‐
103 sions) and therefore all possible activities are collected.
104
105 Important note: The activities (including optional ones) saved
106 in an existing data file prevail over those selected with option
107 -S. As a consequence, appending data to an existing data file
108 will result in option -S being ignored.
109
110 -V Print version number then exit.
111
112
114 The sadc command takes into account the following environment variable:
115
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
124 /usr/lib64/sa/sadc 1 10 /tmp/datafile
125 Write 10 records of one second intervals to the /tmp/datafile
126 binary file.
127
128 /usr/lib64/sa/sadc -C Backup_Start /tmp/datafile
129 Insert the comment Backup_Start into the file /tmp/datafile.
130
132 The /proc filesystem must be mounted for the sadc command to work.
133
134 All the statistics are not necessarily available, depending on the ker‐
135 nel version used. sadc assumes that you are using at least a 2.6 ker‐
136 nel.
137
139 /var/log/sa/saDD
140 /var/log/sa/saYYYYMMDD
141 The standard system activity daily data files and their default
142 location. YYYY stands for the current year, MM for the current
143 month and DD for the current day.
144
145 /proc and /sys contain various files with system statistics.
146
148 Sebastien Godard (sysstat <at> orange.fr)
149
151 sar(1), sa1(8), sa2(8), sadf(1), sysstat(5)
152
153 https://github.com/sysstat/sysstat
154
155 http://pagesperso-orange.fr/sebastien.godard/
156
157
158
159Linux FEBRUARY 2019 SADC(8)