OSDN Git Service

[JM:01533] sysstat-12.0.5 original and translation_list
[linuxjm/jm.git] / manual / sysstat / original / man8 / sadc.8
1 .TH SADC 8 "JULY 2018" Linux "Linux User's Manual" -*- nroff -*-
2 .SH NAME
3 sadc \- System activity data collector.
4 .SH SYNOPSIS
5 .B /usr/lib64/sa/sadc [ -C
6 .I comment
7 .B ] [ -D ] [ -F ] [ -L ] [ -V ] [ -S { keyword [,...] | ALL | XALL } ] [
8 .I interval
9 .B [
10 .I count
11 .B ] ] [
12 .I outfile
13 .B ]
14 .SH DESCRIPTION
15 The
16 .B sadc
17 command samples system data a specified number of times
18 (\fIcount\fR) at a specified interval measured in seconds
19 (\fIinterval\fR). It writes in binary format to the specified
20 .I outfile
21 or to standard output. If
22 .I outfile
23 is set to -, then
24 .B sadc
25 uses the standard system activity daily data file (see below).
26 In this case, if the file already exists,
27 .B sadc
28 will overwrite it if it is from a previous month.
29 By default
30 .B sadc
31 collects most of the data available from the kernel.
32 But there are also optional metrics, for which the
33 relevant options must be explicitly passed to
34 .B sadc
35 to be collected (see option -S below).
36
37 The standard system activity daily data file is named
38 .I saDD
39 unless option
40 .B -D
41 is used, in which case its name is
42 .IR saYYYYMMDD ,
43 where YYYY stands for the current year, MM for the current month
44 and DD for the current day.
45 By default it is located in the
46 .I /var/log/sa
47 directory. Yet it is possible to specify an alternate location for
48 it: If
49 .I outfile
50 is a directory (instead of a plain file) then it will be considered
51 as the directory where the standard system activity daily data file
52 will be saved.
53
54 When the
55 .I count
56 parameter is not specified,
57 .B sadc
58 writes its data endlessly.
59 When both
60 .I interval
61 and
62 .I count
63 are not specified, and option -C is not used,
64 a dummy record, which is used at system startup to mark
65 the time when the counter restarts from 0, will be written.
66 For example, one of the system startup script may write the restart mark to
67 the daily data file by the command entry:
68
69 .B "/usr/lib64/sa/sadc -"
70
71 The
72 .B sadc
73 command is intended to be used as a backend to the
74 .B sar
75 command.
76
77 Note: The
78 .B sadc
79 command only reports on local activities.
80
81 .SH OPTIONS
82 .IP "-C comment"
83 When neither the
84 .I interval
85 nor the
86 .I count
87 parameters are specified, this option tells
88 .B sadc
89 to write a dummy record containing the specified
90 .I comment
91 string.
92 This comment can then be displayed with option -C of
93 .BR sar .
94 .IP -D
95 Use
96 .I saYYYYMMDD
97 instead of
98 .I saDD
99 as the standard system activity daily data file name.
100 .IP -F
101 The creation of
102 .I outfile
103 will be forced. If the file already exists and has a format unknown to
104 .B sadc
105 then it will be truncated. This may be useful for daily data files
106 created by an older version of
107 .B sadc
108 and whose format is no longer compatible with current one.
109 .IP -L
110 .B sadc
111 will try to get an exclusive lock on the
112 .I outfile
113 before writing to it or truncating it. Failure to get the lock is fatal,
114 except in the case of trying to write a normal (i.e. not a dummy and not
115 a header) record to an existing file, in which case
116 .B sadc
117 will try again at the next interval. Usually, the only reason a lock
118 would fail would be if another
119 .B sadc
120 process were also writing to the file. This can happen when cron is used
121 to launch
122 .BR sadc .
123 If the system is under heavy load, an old
124 .B sadc
125 might still be running when cron starts a new one. Without locking,
126 this situation can result in a corrupted system activity file.
127 .IP "-S { keyword [,...] | ALL | XALL }"
128 Possible keywords are DISK, INT, IPV6, POWER, SNMP, XDISK, ALL, and XALL.
129
130 Specify which optional activities should be collected by
131 .BR sadc .
132 Some activities are optional to prevent data files from growing too large.
133 The
134 .B DISK
135 keyword indicates that
136 .B sadc
137 should collect data for block devices.
138 The
139 .B INT
140 keyword indicates that
141 .B sadc
142 should collect data for system interrupts.
143 The
144 .B IPV6
145 keyword indicates that IPv6 statistics should be
146 collected by
147 .BR sadc .
148 The
149 .B POWER
150 keyword indicates that
151 .B sadc
152 should collect power management statistics.
153 The
154 .B SNMP
155 keyword indicates that SNMP statistics should be
156 collected by
157 .BR sadc .
158 The
159 .B ALL
160 keyword is equivalent to specifying all the keywords above and therefore
161 all previous activities are collected.
162
163 The
164 .B XDISK
165 keyword is an extension to the
166 .B DISK
167 one and indicates that partitions and filesystems statistics should be collected by
168 .B sadc
169 in addition to disk statistics. This option works only with kernels 2.6.25
170 and later.
171 The
172 .B XALL
173 keyword is equivalent to specifying all the keywords above (including
174 keyword extensions) and therefore all possible activities are collected.
175
176 Important note: The activities (including optional ones) saved in an existing
177 data file prevail over those selected with option -S.
178 As a consequence, appending data to an existing data file will result in
179 option -S being ignored.
180 .IP -V
181 Print version number then exit.
182
183 .SH ENVIRONMENT
184 The
185 .B sadc
186 command takes into account the following environment variable:
187
188 .IP S_TIME_DEF_TIME
189 If this variable exists and its value is
190 .BR UTC
191 then
192 .B sadc
193 will save its data in UTC time.
194 .B sadc
195 will also use UTC time instead of local time to determine the current
196 daily data file located in the
197 .IR /var/log/sa
198 directory.
199 .SH EXAMPLES
200 .B /usr/lib64/sa/sadc 1 10 /tmp/datafile
201 .RS
202 Write 10 records of one second intervals to the /tmp/datafile binary file.
203 .RE
204
205 .B /usr/lib64/sa/sadc -C Backup_Start /tmp/datafile
206 .RS
207 Insert the comment Backup_Start into the file /tmp/datafile.
208 .RE
209 .SH BUGS
210 The
211 .I /proc
212 filesystem must be mounted for the
213 .B sadc
214 command to work.
215
216 All the statistics are not necessarily available, depending on the kernel version used.
217 .B sadc
218 assumes that you are using at least a 2.6 kernel.
219 .SH FILES
220 .I /var/log/sa/saDD
221 .br
222 .I /var/log/sa/saYYYYMMDD
223 .RS
224 The standard system activity daily data files and their default location.
225 YYYY stands for the current year, MM for the current month and DD for the
226 current day.
227
228 .RE
229 .I /proc
230 and
231 .I /sys
232 contain various files with system statistics.
233 .SH AUTHOR
234 Sebastien Godard (sysstat <at> orange.fr)
235 .SH SEE ALSO
236 .BR sar (1),
237 .BR sa1 (8),
238 .BR sa2 (8),
239 .BR sadf (1),
240 .BR sysstat (5)
241
242 .I https://github.com/sysstat/sysstat
243
244 .I http://pagesperso-orange.fr/sebastien.godard/