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