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