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

NAME

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

SYNOPSIS

9       sadf  [  -C ] [ -c | -d | -g | -j | -p | -r | -x ] [ -H ] [ -h ] [ -T |
10       -t | -U ] [ -V ] [ -O opts [,...] ] [ -P { cpu_list | ALL } ]  [  -s  [
11       hh:mm[:ss]  ]  ]  [ -e [ hh:mm[:ss] ] ] [ -- sar_options ] [ interval [
12       count ] ] [ datafile | -[0-9]+ ]
13

DESCRIPTION

15       The sadf command is used for displaying the contents of data files cre‐
16       ated  by the sar(1) command. But unlike sar, sadf can write its data in
17       many different formats (CSV, XML, etc.)  The default format is one that
18       can  easily  be  handled  by  pattern processing commands like awk (see
19       option -p).  The sadf command can also be used to draw graphs  for  the
20       various  activities  collected by sar and display them as SVG (Scalable
21       Vector Graphics) graphics in your web browser (see option -g).
22
23       The sadf command extracts and writes to standard output  records  saved
24       in  the datafile file. This file must have been created by a version of
25       sar which is compatible with that of sadf.   If  datafile  is  omitted,
26       sadf  uses  the  standard  system activity daily data file.  It is also
27       possible to enter -1, -2 etc. as an argument to sadf to display data of
28       that  days  ago.   For  example,  -1  will point at the standard system
29       activity file of yesterday.
30
31       The standard system activity daily data file is named saDD or  saYYYYM‐
32       MDD,  where  YYYY stands for the current year, MM for the current month
33       and DD for the current day.  sadf will look for the most recent of saDD
34       and saYYYYMMDD, and use it. By default it is located in the /var/log/sa
35       directory. Yet it is possible to specify an alternate location for  it:
36       If  datafile  is  a directory (instead of a plain file) then it will be
37       considered as the directory where the standard  system  activity  daily
38       data file is located.
39
40       The interval and count parameters are used to tell sadf to select count
41       records at interval seconds apart. If the count parameter is  not  set,
42       then all the records saved in the data file will be displayed.
43
44       All  the  activity  flags  of sar may be entered on the command line to
45       indicate which activities are to be reported. Before  specifying  them,
46       put  a  pair of dashes (--) on the command line in order not to confuse
47       the flags with those of sadf.  Not specifying any  flags  selects  only
48       CPU activity.
49
50

OPTIONS

52       -C     Tell sadf to display comments present in file.
53
54       -c     Convert  an  old  system activity binary datafile (version 9.1.6
55              and later) to current up-to-date format. Use the following  syn‐
56              tax:
57
58              sadf -c old_datafile > new_datafile
59
60
61       -d     Print  the contents of the data file in a format that can easily
62              be ingested by a relational database system. The output consists
63              of  fields  separated  by  a semicolon. Each record contains the
64              hostname of the host where the file was  created,  the  interval
65              value  (or -1 if not applicable), the timestamp in a form easily
66              acceptable by most databases, and additional semicolon separated
67              data  fields  as  specified by sar_options command line options.
68              Note that timestamp output can be controlled by options  -T,  -t
69              and -U.
70
71       -e [ hh:mm[:ss] ]
72              Set  the  ending  time  of  the report, given in local time. The
73              default ending time is 18:00:00. Hours must be given in  24-hour
74              format.
75
76       -g     Print  the  contents  of  the  data file in SVG (Scalable Vector
77              Graphics) format.  This option enables you to display some fancy
78              graphs in your web browser.  Use the following syntax:
79
80              sadf -g your_datafile [ -- sar_options ] > output.svg
81
82              and open the resulting SVG file in your favorite web browser.
83
84       -H     Display  only  the header of the report (when applicable). If no
85              format has been specified, then the header  data  (metadata)  of
86              the data file are displayed.
87
88       -h     When  used in conjunction with option -d, all activities will be
89              displayed horizontally on a single line.
90
91       -j     Print the contents of the data file in JSON  (JavaScript  Object
92              Notation) format. Timestamps can be controlled by options -T and
93              -t.
94
95       -O opts [,...]
96              Use the specified options to control the output  of  sadf.   The
97              following  options  are  used to control SVG output displayed by
98              sadf -g:
99
100              autoscale
101                     Draw all the graphs of a given view as large as  possible
102                     based  on current view's scale. To do this, a factor (10,
103                     100, 1000...) is used to enlarge the graph drawing.  This
104                     option  may  be interesting when several graphs are drawn
105                     on the same view, some with only very small  values,  and
106                     others  with  high  ones,  the  latter  making the former
107                     hardly visible.
108
109              height=value
110                     Set SVG canvas height to value.
111
112              oneday
113                     Display graphs data over a period of 24 hours. Note  that
114                     hours are still printed in UTC by default: You should use
115                     option -T to print them in local time and get a time win‐
116                     dow starting from midnight.
117
118              packed
119                     Group  all views from the same activity (and for the same
120                     device) on the same row.
121
122              showidle
123                     Also display %idle state in graphs for CPU statistics.
124
125              showinfo
126                     Display additional information (such as the date and  the
127                     host name) on each view.
128
129              skipempty
130                     Do not display views where all graphs have only zero val‐
131                     ues.
132
133              The following option is used to control raw output displayed  by
134              sadf -r:
135
136              debug
137                     Display  additional information, mainly useful for debug‐
138                     ging purpose.
139
140       -P { cpu_list | ALL }
141              Tell sadf that processor dependent statistics are to be reported
142              only  for  the specified processor or processors.  cpu_list is a
143              list  of  comma-separated  values  or  range  of  values  (e.g.,
144              0,2,4-7,12-).  Note that processor 0 is the first processor, and
145              processor all is the global average among all processors.  Spec‐
146              ifying  the  ALL  keyword reports statistics for each individual
147              processor, and globally for all processors.
148
149       -p     Print the contents of the data file in a format that can  easily
150              be  handled by pattern processing commands like awk.  The output
151              consists of fields separated by a tab. Each record contains  the
152              hostname  of  the  host where the file was created, the interval
153              value (or -1 if not applicable), the timestamp, the device  name
154              (or  -  if  not applicable), the field name and its value.  Note
155              that timestamp output can be controlled by options  -T,  -t  and
156              -U.
157
158       -r     Print  the  raw contents of the data file. With this format, the
159              values for all the counters are displayed as read from the  ker‐
160              nel,  which  means  e.g.,  that no average values are calculated
161              over the elapsed time interval.
162
163       -s [ hh:mm[:ss] ]
164              Set the starting time of the data (given in local time), causing
165              the  sadf  command to extract records time-tagged at, or follow‐
166              ing, the time specified. The default starting time is  08:00:00.
167              Hours must be given in 24-hour format.
168
169       -T     Display timestamp in local time instead of UTC (Coordinated Uni‐
170              versal Time).
171
172       -t     Display timestamp in the original local time of  the  data  file
173              creator instead of UTC (Coordinated Universal Time).
174
175       -U     Display  timestamp (UTC - Coordinated Universal Time) in seconds
176              from the epoch.
177
178       -V     Print version number then exit.
179
180       -x     Print the contents of the data file in XML  format.   Timestamps
181              can  be  controlled by options -T and -t.  The corresponding DTD
182              (Document Type Definition) and XML Schema are  included  in  the
183              sysstat source package. They are also available at http://pages
184              perso-orange.fr/sebastien.godard/download.html
185
186

ENVIRONMENT

188       The sadf command takes into account the following environment variable:
189
190
191       S_TIME_DEF_TIME
192              If this variable exists and its value is UTC then sadf will  use
193              UTC  time  instead  of local time to determine the current daily
194              data file located in the /var/log/sa directory.
195

EXAMPLES

197       sadf -d /var/log/sa/sa21 -- -r -n DEV
198              Extract memory and network statistics from system activity  file
199              'sa21',  and  display them in a format that can be ingested by a
200              database.
201
202       sadf -p -P 1
203              Extract CPU statistics for processor 1  (the  second  processor)
204              from  current daily data file, and display them in a format that
205              can easily be handled by a pattern processing command.
206
207

BUGS

209       SVG output (as created by option -g) is fully compliant  with  SVG  1.1
210       standard.   Graphics  have  been  successfully displayed in various web
211       browsers, including Firefox, Chrome and Opera.  Yet  SVG  rendering  is
212       broken  on  Microsoft browsers (tested on Internet Explorer 11 and Edge
213       13.1): So please don't use them.
214
215

FILES

217       /var/log/sa/saDD
218       /var/log/sa/saYYYYMMDD
219              The standard system activity daily data files and their  default
220              location.   YYYY stands for the current year, MM for the current
221              month and DD for the current day.
222
223

AUTHOR

225       Sebastien Godard (sysstat <at> orange.fr)
226

SEE ALSO

228       sar(1), sadc(8), sa1(8), sa2(8), sysstat(5)
229
230       http://pagesperso-orange.fr/sebastien.godard/
231
232
233
234Linux                            JANUARY 2018                          SADF(1)
Impressum