1SADF(1) Linux User's Manual SADF(1)
2
3
4
6 sadf - Display data collected by sar in multiple formats.
7
8
10 sadf [ -C ] [ -c | -d | -g | -j | -l | -p | -r | -x ] [ -H ] [ -h ] [
11 -T | -t | -U ] [ -V ] [ -O opts [,...] ] [ -P { cpu_list | ALL } ] [ -s
12 [ start_time ] ] ] [ -e [ end_time ] ] ] [ --dev=dev_list ] [
13 --fs=fs_list ] [ --iface=iface_list] [ --int=int_list ] [ -- sar_op‐
14 tions ] [ interval [ count ] ] [ datafile | -[0-9]+ ]
15
16
18 The sadf command is used for displaying the contents of data files cre‐
19 ated by the sar(1) command. But unlike sar, sadf can write its data in
20 many different formats (CSV, XML, etc.) The default format is one that
21 can easily be handled by pattern processing commands like awk (see op‐
22 tion -p). The sadf command can also be used to draw graphs for the var‐
23 ious activities collected by sar and display them as SVG (Scalable Vec‐
24 tor Graphics) graphics in your web browser (see option -g).
25
26 The sadf command extracts and writes to standard output records saved
27 in the datafile file. This file must have been created by a version of
28 sar which is compatible with that of sadf. If datafile is omitted, sadf
29 uses the standard system activity daily data file. It is also possible
30 to enter -1, -2 etc. as an argument to sadf to display data of that
31 days ago. For example, -1 will point at the standard system activity
32 file of yesterday.
33
34 The standard system activity daily data file is named saDD or saYYYYM‐
35 MDD, where YYYY stands for the current year, MM for the current month
36 and DD for the current day. sadf will look for the most recent of saDD
37 and saYYYYMMDD, and use it. By default it is located in the /var/log/sa
38 directory. Yet it is possible to specify an alternate location for it:
39 If datafile is a directory (instead of a plain file) then it will be
40 considered as the directory where the standard system activity daily
41 data file is located.
42
43 The interval and count parameters are used to tell sadf to select count
44 records at interval seconds apart. If the count parameter is not set,
45 then all the records saved in the data file will be displayed.
46
47 All the activity flags of sar may be entered on the command line to in‐
48 dicate which activities are to be reported. Before specifying them, put
49 a pair of dashes (--) on the command line in order not to confuse the
50 flags with those of sadf. Not specifying any flags selects only CPU
51 activity.
52
53
55 -C Tell sadf to display comments present in file.
56
57 -c Convert an old system activity binary datafile (version 9.1.6
58 and later) to current up-to-date format. Use the following syn‐
59 tax:
60
61 sadf -c old_datafile > new_datafile
62
63 Conversion can be controlled using option -O (see below).
64
65 -d Print the contents of the data file in a format that can easily
66 be ingested by a relational database system. The output consists
67 of fields separated by a semicolon. Each record contains the
68 hostname of the host where the file was created, the interval
69 value (or -1 if not applicable), the timestamp in a form easily
70 acceptable by most databases, and additional semicolon separated
71 data fields as specified by sar_options command line options.
72 Note that timestamp output can be controlled by options -T, -t
73 and -U.
74
75 --dev=dev_list
76 Specify the block devices for which statistics are to be dis‐
77 played by sadf. dev_list is a list of comma-separated device
78 names. Useful with option -d from sar.
79
80 -e [ hh:mm[:ss] ]
81 -e [ seconds_since_the_epoch ]
82 Set the ending time of the report. The default ending time is
83 18:00:00. Hours must be given in 24-hour format, or as the num‐
84 ber of seconds since the epoch (given as a 10 digit number).
85
86 --fs=fs_list
87 Specify the filesystems for which statistics are to be displayed
88 by sadf. fs_list is a list of comma-separated filesystem names
89 or mountpoints. Useful with option -F from sar.
90
91 -g Print the contents of the data file in SVG (Scalable Vector
92 Graphics) format. This option enables you to display some fancy
93 graphs in your web browser. Use the following syntax:
94
95 sadf -g your_datafile [ -- sar_options ] > output.svg
96
97 and open the resulting SVG file in your favorite web browser.
98 Output can be controlled using option -O (see below).
99
100 -H Display only the header of the report (when applicable). If no
101 format has been specified, then the header data (metadata) of
102 the data file are displayed.
103
104 -h When used in conjunction with option -d, all activities will be
105 displayed horizontally on a single line.
106
107 --iface=iface_list
108 Specify the network interfaces for which statistics are to be
109 displayed by sadf. iface_list is a list of comma-separated in‐
110 terface names. Useful with options -n DEV and -n EDEV from sar.
111
112 --int=int_list
113 Specify the interrupts names for which statistics are to be dis‐
114 played by sadf. int_list is a list of comma-separated values or
115 range of values (e.g., 0-16,35,40-). Useful with option -I from
116 sar.
117
118 -j Print the contents of the data file in JSON (JavaScript Object
119 Notation) format. Timestamps can be controlled by options -T and
120 -t.
121
122 -l Export the contents of the data file to a PCP (Performance Co-
123 Pilot) archive. The name of the archive can be specified using
124 the keyword pcparchive= with option -O.
125
126 -O opts[,...]
127 Use the specified options to control the output of sadf. The
128 following options are used to control SVG output displayed by
129 sadf -g:
130
131 autoscale
132 Draw all the graphs of a given view as large as possible
133 based on current view's scale. To do this, a factor (10,
134 100, 1000...) is used to enlarge the graph drawing. This
135 option may be interesting when several graphs are drawn
136 on the same view, some with only very small values, and
137 others with high ones, the latter making the former
138 hardly visible.
139
140 bwcol Use a black and white palette to draw the graphs.
141
142 customcol
143 Use a customizable color palette instead of the default
144 one to draw the graphs. See environment variable S_COL‐
145 ORS_PALETTE below to know how to customize that palette.
146
147 debug Add helpful comments in SVG output file.
148
149 height=value
150 Set SVG canvas height to value.
151
152 oneday Display graphs data over a period of 24 hours. Note that
153 hours are still printed in UTC by default: You should use
154 option -T to print them in local time and get a time win‐
155 dow starting from midnight.
156
157 packed Group all views from the same activity (and for the same
158 device) on the same row.
159
160 showidle
161 Also display %idle state in graphs for CPU statistics.
162
163 showinfo
164 Display additional information (such as the date and the
165 host name) on each view.
166
167 showtoc
168 Add a table of contents at the beginning of the SVG out‐
169 put, consisting of links pointing at the first graph of
170 each activity.
171
172 skipempty
173 Do not display views where all graphs have only zero val‐
174 ues.
175
176 The following option may be used when converting an old system
177 activity binary datafile to current up-to-date format:
178
179 hz=value
180 Specify the number of ticks per second for the machine
181 where the old datafile has been created.
182
183 The following option may be used when data are exported to a PCP
184 archive:
185
186 pcparchive=name
187 Specify the name of the PCP archive to create.
188
189 The following option is used to control raw output displayed by
190 sadf -r:
191
192 debug Display additional information, mainly useful for debug‐
193 ging purpose.
194
195 -P { cpu_list | ALL }
196 Tell sadf that processor dependent statistics are to be reported
197 only for the specified processor or processors. cpu_list is a
198 list of comma-separated values or range of values (e.g.,
199 0,2,4-7,12-). Note that processor 0 is the first processor, and
200 processor all is the global average among all processors. Speci‐
201 fying the ALL keyword reports statistics for each individual
202 processor, and globally for all processors.
203
204 -p Print the contents of the data file in a format that can easily
205 be handled by pattern processing commands like awk. The output
206 consists of fields separated by a tab. Each record contains the
207 hostname of the host where the file was created, the interval
208 value (or -1 if not applicable), the timestamp, the device name
209 (or - if not applicable), the field name and its value. Note
210 that timestamp output can be controlled by options -T, -t and
211 -U.
212
213 -r Print the raw contents of the data file. With this format, the
214 values for all the counters are displayed as read from the ker‐
215 nel, which means e.g., that no average values are calculated
216 over the elapsed time interval. Output can be controlled using
217 option -O (see above).
218
219 -s [ hh:mm[:ss] ]
220 -s [ seconds_since_the_epoch ]
221 Set the starting time of the data, causing the sadf command to
222 extract records time-tagged at, or following, the time speci‐
223 fied. The default starting time is 08:00:00. Hours must be
224 given in 24-hour format, or as the number of seconds since the
225 epoch (given as a 10 digit number).
226
227 -T Display timestamp in local time instead of UTC (Coordinated Uni‐
228 versal Time).
229
230 -t Display timestamp in the original local time of the data file
231 creator instead of UTC (Coordinated Universal Time).
232
233 -U Display timestamp (UTC - Coordinated Universal Time) in seconds
234 from the epoch.
235
236 -V Print version number then exit.
237
238 -x Print the contents of the data file in XML format. Timestamps
239 can be controlled by options -T and -t. The corresponding DTD
240 (Document Type Definition) and XML Schema are included in the
241 sysstat source package. They are also available at https://sys‐
242 stat.github.io/.
243
244
246 The sadf command takes into account the following environment vari‐
247 ables:
248
249 S_COLORS_PALETTE
250 Specify the colors used by sadf -g to render the SVG output.
251 This environment variable is taken into account only when the
252 custom color palette has been selected with the option customcol
253 (see option -O). Its value is a colon-separated list of capa‐
254 bilities associated with six-digit, three-byte hexadecimal num‐
255 bers (hex triplets) representing colors that defaults to
256
257 0=000000:1=1a1aff:2=1affb2:3=b21aff:
258 4=1ab2ff:5=ff1a1a:6=ffb31a:7=b2ff1a:
259 8=efefef:9=000000:A=1a1aff:B=1affb2:
260 C=b21aff:D=1ab2ff:E=ff1a1a:F=ffb31a:
261 G=bebebe:H=000000:I=000000:K=ffffff:
262 L=000000:T=000000:W=000000:X=000000
263
264 Capabilities consisting of a hexadecimal digit (0 through F) are
265 used to specify the first sixteen colors in the palette (these
266 colors are used to draw the graphs), e.g., 3=ffffff would indi‐
267 cate that the third color in the palette is white (0xffffff).
268 Other capabilities are:
269
270 G= Specify the color used to draw the grid lines.
271
272 H= Specify the color used to display the report header.
273
274 I= Specify the color used to display additional information
275 (e.g., date, hostname...)
276
277 K= Specify the color used for the graphs background.
278
279 L= Specify the default color (which is for example used to
280 display the table of contents).
281
282 T= Specify the color used to display the graphs title.
283
284 W= Specify the color used to display warning and error mes‐
285 sages.
286
287 X= Specify the color used to draw the axes and display the
288 graduations.
289
290 S_TIME_DEF_TIME
291 If this variable exists and its value is UTC then sadf will use
292 UTC time instead of local time to determine the current daily
293 data file located in the /var/log/sa directory.
294
295
297 sadf -d /var/log/sa/sa21 -- -r -n DEV
298 Extract memory and network statistics from system activity file
299 sa21, and display them in a format that can be ingested by a
300 database.
301
302 sadf -p -P 1
303 Extract CPU statistics for processor 1 (the second processor)
304 from current daily data file, and display them in a format that
305 can easily be handled by a pattern processing command.
306
307
309 SVG output (as created by option -g) is fully compliant with SVG 1.1
310 standard. Graphics have been successfully displayed in various web
311 browsers, including Firefox, Chrome and Opera. Yet SVG rendering is
312 broken on Microsoft browsers (tested on Internet Explorer 11 and Edge
313 13.1): So please don't use them.
314
315
317 /var/log/sa/saDD
318 /var/log/sa/saYYYYMMDD
319 The standard system activity daily data files and their default
320 location. YYYY stands for the current year, MM for the current
321 month and DD for the current day.
322
323
325 Sebastien Godard (sysstat <at> orange.fr)
326
327
329 sar(1), sadc(8), sa1(8), sa2(8), sysstat(5)
330
331 https://github.com/sysstat/sysstat
332
333
334
335Linux MAY 2023 SADF(1)