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 -*-
4 sadf \- Display data collected by sar in multiple formats.
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]+ " "]"
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
23 and display them as SVG (Scalable Vector Graphics) graphics in your web browser
28 command extracts and writes to standard output records saved in the
30 file. This file must have been created by a version of
31 .BR "sar " "which is compatible with that of " "sadf" ". If"
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,
39 will point at the standard system activity file of yesterday.
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"
46 will look for the most recent of
47 .IR "saDD " "and " "saYYYYMMDD" ","
48 and use it. By default it is located in the
50 directory. Yet it is possible to specify an alternate location for it: If
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.
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.
60 All the activity flags of
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
65 on the command line in order not to confuse the flags with those of
67 Not specifying any flags selects only CPU activity.
72 .RB "Tell " "sadf " "to display comments present in file."
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:
78 .BI "sadf -c " "old_datafile " "> " "new_datafile"
80 Conversion can be controlled using option
81 .BR "-O " "(see below)."
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" "."
94 .BI "--dev=" "dev_list"
95 Specify the block devices for which statistics are to be displayed by
98 is a list of comma-separated device names. Useful with option
99 .BR "-d " "from " "sar" "."
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.
105 .BI "--fs=" "fs_list"
106 Specify the filesystems for which statistics are to be displayed by
109 is a list of comma-separated filesystem names or mountpoints. Useful with option
110 .BR "-F " "from " "sar" "."
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:
117 .BI "sadf -g " "your_datafile " "[ -- " "sar_options " "] > " "output.svg"
119 and open the resulting SVG file in your favorite web browser.
120 Output can be controlled using option
121 .BR "-O " "(see below)."
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.
128 When used in conjunction with option
129 .BR "-d" ", all activities will be displayed horizontally on a single line."
131 .BI "--iface=" "iface_list"
132 Specify the network interfaces for which statistics are to be displayed by
135 is a list of comma-separated interface names. Useful with options
136 .BR "-n DEV " "and " "-n EDEV " "from " "sar" "."
138 .BI "--int=" "int_list"
139 Specify the interrupts names for which statistics are to be displayed by
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" "."
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" "."
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" "."
155 .BI "-O " "opts" "[,...]"
156 Use the specified options to control the output of
158 The following options are used to control SVG output displayed by
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.
169 Use a black and white palette to draw the graphs.
171 Use a customizable color palette instead of the default one to draw
172 the graphs. See environment variable
174 below to know how to customize that palette.
176 Add helpful comments in SVG output file.
178 .RI "height=" "value"
179 Set SVG canvas height to
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.
187 Group all views from the same activity (and for the same device) on the same row.
189 Also display %idle state in graphs for CPU statistics.
191 Display additional information (such as the date and the host name) on each view.
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.
196 Do not display views where all graphs have only zero values.
199 The following option may be used when converting an old system activity binary datafile
200 to current up-to-date format:
204 Specify the number of ticks per second for the machine where the old datafile has been created.
207 The following option may be used when data are exported to a PCP archive:
210 .RI "pcparchive=" "name"
211 Specify the name of the PCP archive to create.
214 The following option is used to control raw output displayed by
218 Display additional information, mainly useful for debugging purpose.
221 .BI "-P { " "cpu_list " "| ALL }"
223 that processor dependent statistics are to be reported only for the
224 specified processor or processors.
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
234 Print the contents of the data file in a format that can
235 easily be handled by pattern processing commands like
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" "."
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)."
251 .BI "-s [ " "hh" ":" "mm" "[:" "ss" "] ]"
252 Set the starting time of the data, causing the
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.
259 Display timestamp in local time instead of UTC (Coordinated Universal Time).
262 Display timestamp in the original local time of the data file creator
263 instead of UTC (Coordinated Universal Time).
266 Display timestamp (UTC - Coordinated Universal Time) in seconds from the epoch.
269 Print version number then exit.
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" "."
281 command takes into account the following environment variables:
284 Specify the colors used by
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
293 .B 0=000000:1=1a1aff:2=1affb2:3=b21aff:
295 .B 4=1ab2ff:5=ff1a1a:6=ffb31a:7=b2ff1a:
297 .B 8=efefef:9=000000:A=1a1aff:B=1affb2:
299 .B C=b21aff:D=1ab2ff:E=ff1a1a:F=ffb31a:
301 .B G=bebebe:H=000000:I=000000:K=ffffff:
303 .B L=000000:T=000000:W=000000:X=000000
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).
310 Other capabilities are:
314 Specify the color used to draw the grid lines.
317 Specify the color used to display the report header.
320 Specify the color used to display additional information (e.g., date, hostname...)
323 Specify the color used for the graphs background.
326 Specify the default color (which is for example used to display the table of contents).
329 Specify the color used to display the graphs title.
332 Specify the color used to display warning and error messages.
335 Specify the color used to draw the axes and display the graduations.
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
348 .B sadf -d @SA_DIR@/sa21 -- -r -n DEV
349 Extract memory and network statistics from system activity file
351 and display them in a format that can be ingested by a database.
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.
359 SVG output (as created by option
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.
369 .I @SA_DIR@/saYYYYMMDD
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"
377 Sebastien Godard (sysstat <at> orange.fr)
380 .BR "sar" "(1), " "sadc" "(8), " "sa1" "(8), " "sa2" "(8), " "sysstat" "(5)"
382 .I https://github.com/sysstat/sysstat
384 .I http://pagesperso-orange.fr/sebastien.godard/