1SADF(1) Linux User's Manual SADF(1)
2
3
4
6 sadf - Display data collected by sar in multiple formats.
7
9 sadf [ -d | -D | -H | -p | -x ] [ -h ] [ -t ] [ -V ] [ -P { cpu [,...]
10 | ALL } ] [ -s [ hh:mm:ss ] ] [ -e [ hh:mm:ss ] ] [ -- sar_options ] [
11 interval [ count ] ] [ datafile ]
12
14 The sadf command is used for displaying the contents of data files cre‐
15 ated by the sar(1) command. But unlike sar, sadf can write its data in
16 many different formats (CSV, XML, etc.) The default format is one that
17 can easily be handled by pattern processing commands like awk (see
18 option -p).
19
20 The sadf command extracts and writes to standard output records saved
21 in the datafile file. This file must have been created by a version of
22 sar which is compatible with that of sadf. If datafile is omitted,
23 sadf uses the standard system activity file, the /var/log/sa/sadd file,
24 where the dd parameter indicates the current day.
25
26 The interval and count parameters are used to tell sadf to select count
27 records at interval seconds apart. If the count parameter is not set,
28 then all the records saved in the data file will be displayed.
29
30 All the activity flags of sar may be entered on the command line to
31 indicate which activities are to be reported. Before specifying them,
32 put a pair of dashes (--) on the command line in order not to confuse
33 the flags with those of sadf. Not specifying any flags selects only
34 CPU activity.
35
36
38 -D This option is equivalent to option -d below, except that the
39 timestamp is always expressed in seconds since the epoch
40 (00:00:00 UTC 01/01/1970).
41
42 -d Print the contents of the data file in a format that can easily
43 be ingested by a relational database system. The output consists
44 of fields separated by a semicolon. Each record contains the
45 hostname of the host where the file was created, the interval
46 value (or -1 if not applicable), the timestamp in a form easily
47 acceptable by most databases, and additional semicolon separated
48 data fields as specified by sar_options command line options.
49 Note that the timestamp is displayed in UTC (Coordinated Univer‐
50 sal Time) unless option -t is used. In this latter case, the
51 timestamp is displayed in local time.
52
53 -e [ hh:mm:ss ]
54 Set the ending time of the report, given in local time. The
55 default ending time is 18:00:00. Hours must be given in 24-hour
56 format. This option is ignored when option -x is used.
57
58 -h When used in conjunction with option -d or -D, all activities
59 will be displayed horizontally on a single line.
60
61 -H Display the header of the data file.
62
63 -P { cpu [,...] | ALL }
64 Tell sadf that processor dependent statistics are to be reported
65 only for the specified processor or processors. Specifying the
66 ALL keyword reports statistics for each individual processor,
67 and globally for all processors. Note that processor 0 is the
68 first processor.
69
70 -p Print the contents of the data file in a format that can easily
71 be handled by pattern processing commands like awk. The output
72 consists of fields separated by a tab. Each record contains the
73 hostname of the host where the file was created, the interval
74 value (or -1 if not applicable), the timestamp (UTC value -
75 Coordinated Universal Time) in seconds from the epoch, the
76 device name (or - if not applicable), the field name and its
77 value.
78
79 -s [ hh:mm:ss ]
80 Set the starting time of the data (given in local time), causing
81 the sadf command to extract records time-tagged at, or follow‐
82 ing, the time specified. The default starting time is 08:00:00.
83 Hours must be given in 24-hour format. This option is ignored
84 when option -x is used.
85
86 -t When this option is used together with options -d or -x, the
87 timestamp is displayed in local time instead of UTC (Coordinated
88 Universal Time). This option is ignored when options -p or -D
89 are used.
90
91 -V Print version number then exit.
92
93 -x Print the contents of the data file in XML format. Timestamps
94 are displayed in UTC (Coordinated Universal Time) unless option
95 -t is used, in which case they are displayed in local time. The
96 corresponding DTD (Document Type Definition) and XML Schema are
97 included in the sysstat source package. They are also available
98 at http://pagesperso-orange.fr/sebastien.godard/download.html
99
100
102 The sadf command takes into account the following environment variable:
103
104
105 S_TIME_DEF_TIME
106 If this variable exists and its value is UTC then sadf will use
107 UTC time instead of local time to determine the current daily
108 data file located in the /var/log/sa directory.
109
111 sadf -d /var/log/sa/sa21 -- -r -n DEV
112 Extract memory, swap space and network statistics from system
113 activity file 'sa21', and display them in a format that can be
114 ingested by a database.
115
116 sadf -p -P 1
117 Extract CPU statistics for processor 1 (the second processor)
118 from current daily data file, and display them in a format that
119 can easily be handled by a pattern processing command.
120
121
123 /var/log/sa/sadd
124 Indicate the daily data file, where the dd parameter is a number
125 representing the day of the month.
126
127
129 Sebastien Godard (sysstat <at> orange.fr)
130
132 sar(1), sadc(8), sa1(8), sa2(8), isag(1)
133
134 http://pagesperso-orange.fr/sebastien.godard/
135
136
137
138Linux DECEMBER 2008 SADF(1)