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