1SADF(1)                       Linux User's Manual                      SADF(1)
2
3
4

NAME

6       sadf - Display data collected by sar in multiple formats.
7
8

SYNOPSIS

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] [ -- sar_options ] [ interval [  count  ]  ]  [
14       datafile | -[0-9]+ ]
15
16

DESCRIPTION

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

OPTIONS

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       -j     Print  the  contents of the data file in JSON (JavaScript Object
111              Notation) format. Timestamps can be controlled by options -T and
112              -t.
113
114       -l     Export  the  contents of the data file to a PCP (Performance Co-
115              Pilot) archive.  The name of the archive can be specified  using
116              the keyword pcparchive= with option -O.
117
118       -O opts[,...]
119              Use  the  specified  options to control the output of sadf.  The
120              following options are used to control SVG  output  displayed  by
121              sadf -g:
122
123              autoscale
124                     Draw  all the graphs of a given view as large as possible
125                     based on current view's scale. To do this, a factor  (10,
126                     100, 1000...) is used to enlarge the graph drawing.  This
127                     option may be interesting when several graphs  are  drawn
128                     on  the  same view, some with only very small values, and
129                     others with high  ones,  the  latter  making  the  former
130                     hardly visible.
131
132              bwcol  Use a black and white palette to draw the graphs.
133
134              customcol
135                     Use  a  customizable color palette instead of the default
136                     one to draw the graphs. See environment  variable  S_COL‐
137                     ORS_PALETTE below to know how to customize that palette.
138
139              debug  Add helpful comments in SVG output file.
140
141              height=value
142                     Set SVG canvas height to value.
143
144              oneday Display  graphs data over a period of 24 hours. Note that
145                     hours are still printed in UTC by default: You should use
146                     option -T to print them in local time and get a time win‐
147                     dow starting from midnight.
148
149              packed Group all views from the same activity (and for the  same
150                     device) on the same row.
151
152              showidle
153                     Also display %idle state in graphs for CPU statistics.
154
155              showinfo
156                     Display  additional information (such as the date and the
157                     host name) on each view.
158
159              showtoc
160                     Add a table of contents at the beginning of the SVG  out‐
161                     put,  consisting  of links pointing at the first graph of
162                     each activity.
163
164              skipempty
165                     Do not display views where all graphs have only zero val‐
166                     ues.
167
168              The  following  option may be used when converting an old system
169              activity binary datafile to current up-to-date format:
170
171              hz=value
172                     Specify the number of ticks per second  for  the  machine
173                     where the old datafile has been created.
174
175              The following option may be used when data are exported to a PCP
176              archive:
177
178              pcparchive=name
179                     Specify the name of the PCP archive to create.
180
181              The following option is used to control raw output displayed  by
182              sadf -r:
183
184              debug  Display  additional information, mainly useful for debug‐
185                     ging purpose.
186
187       -P { cpu_list | ALL }
188              Tell sadf that processor dependent statistics are to be reported
189              only  for  the specified processor or processors.  cpu_list is a
190              list  of  comma-separated  values  or  range  of  values  (e.g.,
191              0,2,4-7,12-).  Note that processor 0 is the first processor, and
192              processor all is the global average among all processors. Speci‐
193              fying  the  ALL  keyword  reports statistics for each individual
194              processor, and globally for all processors.
195
196       -p     Print the contents of the data file in a format that can  easily
197              be  handled by pattern processing commands like awk.  The output
198              consists of fields separated by a tab. Each record contains  the
199              hostname  of  the  host where the file was created, the interval
200              value (or -1 if not applicable), the timestamp, the device  name
201              (or  -  if  not applicable), the field name and its value.  Note
202              that timestamp output can be controlled by options  -T,  -t  and
203              -U.
204
205       -r     Print  the  raw contents of the data file. With this format, the
206              values for all the counters are displayed as read from the  ker‐
207              nel,  which  means  e.g.,  that no average values are calculated
208              over the elapsed time interval.  Output can be controlled  using
209              option -O (see above).
210
211       -s [ hh:mm[:ss] ]
212              Set  the  starting time of the data, causing the sadf command to
213              extract records time-tagged at, or following,  the  time  speci‐
214              fied.  The  default  starting  time  is 08:00:00.  Hours must be
215              given in 24-hour format.
216
217       -T     Display timestamp in local time instead of UTC (Coordinated Uni‐
218              versal Time).
219
220       -t     Display  timestamp  in  the original local time of the data file
221              creator instead of UTC (Coordinated Universal Time).
222
223       -U     Display timestamp (UTC - Coordinated Universal Time) in  seconds
224              from the epoch.
225
226       -V     Print version number then exit.
227
228       -x     Print  the  contents of the data file in XML format.  Timestamps
229              can be controlled by options -T and -t.  The  corresponding  DTD
230              (Document  Type  Definition)  and XML Schema are included in the
231              sysstat source package. They are also available at http://pages
232              perso-orange.fr/sebastien.godard/download.html.
233
234

ENVIRONMENT

236       The  sadf  command  takes  into account the following environment vari‐
237       ables:
238
239       S_COLORS_PALETTE
240              Specify the colors used by sadf -g to  render  the  SVG  output.
241              This  environment  variable  is taken into account only when the
242              custom color palette has been selected with the option customcol
243              (see  option  -O).  Its value is a colon-separated list of capa‐
244              bilities associated with six-digit, three-byte hexadecimal  num‐
245              bers (hex triplets) representing colors that defaults to
246
247              0=000000:1=1a1aff:2=1affb2:3=b21aff:
248              4=1ab2ff:5=ff1a1a:6=ffb31a:7=b2ff1a:
249              8=efefef:9=000000:A=1a1aff:B=1affb2:
250              C=b21aff:D=1ab2ff:E=ff1a1a:F=ffb31a:
251              G=bebebe:H=000000:I=000000:K=ffffff:
252              L=000000:T=000000:W=000000:X=000000
253
254              Capabilities  consisting  of  an hexadecimal digit (0 through F)
255              are used to specify the first  sixteen  colors  in  the  palette
256              (these colors are used to draw the graphs), e.g., 3=ffffff would
257              indicate  that  the  third  color  in  the  palette   is   white
258              (0xffffff).
259              Other capabilities are:
260
261              G=     Specify the color used to draw the grid lines.
262
263              H=     Specify the color used to display the report header.
264
265              I=     Specify  the color used to display additional information
266                     (e.g., date, hostname...)
267
268              K=     Specify the color used for the graphs background.
269
270              L=     Specify the default color (which is for example  used  to
271                     display the table of contents).
272
273              T=     Specify the color used to display the graphs title.
274
275              W=     Specify  the color used to display warning and error mes‐
276                     sages.
277
278              X=     Specify the color used to draw the axes and  display  the
279                     graduations.
280
281       S_TIME_DEF_TIME
282              If  this variable exists and its value is UTC then sadf will use
283              UTC time instead of local time to determine  the  current  daily
284              data file located in the /var/log/sa directory.
285
286

EXAMPLES

288       sadf -d /var/log/sa/sa21 -- -r -n DEV
289              Extract  memory and network statistics from system activity file
290              sa21, and display them in a format that can  be  ingested  by  a
291              database.
292
293       sadf -p -P 1
294              Extract  CPU  statistics  for processor 1 (the second processor)
295              from current daily data file, and display them in a format  that
296              can easily be handled by a pattern processing command.
297
298

BUGS

300       SVG  output  (as  created by option -g) is fully compliant with SVG 1.1
301       standard.  Graphics have been successfully  displayed  in  various  web
302       browsers,  including  Firefox,  Chrome  and Opera. Yet SVG rendering is
303       broken on Microsoft browsers (tested on Internet Explorer 11  and  Edge
304       13.1): So please don't use them.
305
306

FILES

308       /var/log/sa/saDD
309       /var/log/sa/saYYYYMMDD
310              The  standard system activity daily data files and their default
311              location.  YYYY stands for the current year, MM for the  current
312              month and DD for the current day.
313
314

AUTHOR

316       Sebastien Godard (sysstat <at> orange.fr)
317
318

SEE ALSO

320       sar(1), sadc(8), sa1(8), sa2(8), sysstat(5)
321
322       https://github.com/sysstat/sysstat
323       http://pagesperso-orange.fr/sebastien.godard/
324
325
326
327Linux                              JULY 2020                           SADF(1)
Impressum