1SADC(8) Linux User's Manual SADC(8)
2
3
4
6 sadc - System activity data collector.
7
9 /usr/lib64/sa/sadc [ -C comment ] [ -F ] [ -L ] [ -V ] [ -S { INT |
10 DISK | SNMP | IPV6 | POWER | XDISK | ALL | XALL } ] [ interval [ count
11 ] ] [ outfile ]
12
14 The sadc command samples system data a specified number of times
15 (count) at a specified interval measured in seconds (interval). It
16 writes in binary format to the specified outfile or to standard output.
17 If outfile is set to -, then sadc uses the standard system activity
18 daily data file, the /var/log/sa/sadd file, where the dd parameter
19 indicates the current day. In this case, sadc will overwrite the file
20 if it is from a previous month. By default sadc collects all the data
21 available from the kernel. Exceptions are interrupts and disk data,
22 for which the relevant options must be explicitly passed to sadc (see
23 options below).
24
25 When the count parameter is not specified, sadc writes its data end‐
26 lessly. When both interval and count are not specified, and option -C
27 is not used, a dummy record, which is used at system startup to mark
28 the time when the counter restarts from 0, will be written. For exam‐
29 ple, one of the system startup script may write the restart mark to the
30 daily data file by the command entry:
31
32 /usr/lib64/sa/sadc -
33
34 The sadc command is intended to be used as a backend to the sar com‐
35 mand.
36
37 Note: The sadc command only reports on local activities.
38
39
41 -C comment
42 When neither the interval nor the count parameters are speci‐
43 fied, this option tells sadc to write a dummy record containing
44 the specified comment string. This comment can then be dis‐
45 played with option -C of sar.
46
47 -F The creation of outfile will be forced. If the file already
48 exists and has a format unknown to sadc then it will be trun‐
49 cated. This may be useful for daily data files created by an
50 older version of sadc and whose format is no longer compatible
51 with current one.
52
53 -L sadc will try to get an exclusive lock on the outfile before
54 writing to it or truncating it. Failure to get the lock is
55 fatal, except in the case of trying to write a normal (i.e. not
56 a dummy and not a header) record to an existing file, in which
57 case sadc will try again at the next interval. Usually, the only
58 reason a lock would fail would be if another sadc process were
59 also writing to the file. This can happen when cron is used to
60 launch sadc. If the system is under heavy load, an old sadc
61 might still be running when cron starts a new one. Without lock‐
62 ing, this situation can result in a corrupted system activity
63 file.
64
65 -S { INT | DISK | SNMP | IPV6 | POWER | XDISK | ALL | XALL }
66 Specify which optional activities should be collected by sadc.
67 Some activities are optional to prevent data files from growing
68 too large. The INT keyword indicates that sadc should collect
69 data for system interrupts. The DISK keyword indicates that
70 sadc should collect data for block devices. The SNMP and IPV6
71 keywords indicate respectively that SNMP and IPv6 statistics
72 should be collected by sadc. The POWER keyword indicates that
73 sadc should collect power management statistics. The ALL key‐
74 word is equivalent to specifying all the keywords above and
75 therefore all previous activities are collected.
76
77 The XDISK keyword is an extension to the DISK one and indicates
78 that partitions and filesystems statistics should be collected
79 by sadc in addition to disk statistics. This option works only
80 with kernels 2.6.25 and later. The XALL keyword is equivalent
81 to specifying all the keywords above (including keyword exten‐
82 sions) and therefore all possible activities are collected.
83
84 Important note: The activities (including optional ones) saved
85 in an existing data file prevail over those selected with option
86 -S. As a consequence, appending data to an existing data file
87 will result in option -S being ignored.
88
89 -V Print version number then exit.
90
91
93 The sadc command takes into account the following environment variable:
94
95
96 S_TIME_DEF_TIME
97 If this variable exists and its value is UTC then sadc will save
98 its data in UTC time. sadc will also use UTC time instead of
99 local time to determine the current daily data file located in
100 the /var/log/sa directory.
101
103 /usr/lib64/sa/sadc 1 10 /tmp/datafile
104 Write 10 records of one second intervals to the /tmp/datafile
105 binary file.
106
107 /usr/lib64/sa/sadc -C Backup_Start /tmp/datafile
108 Insert the comment Backup_Start into the file /tmp/datafile.
109
111 The /proc filesystem must be mounted for the sadc command to work.
112
113 All the statistics are not necessarily available, depending on the ker‐
114 nel version used. sadc assumes that you are using at least a 2.6 ker‐
115 nel.
116
118 /var/log/sa/sadd
119 Indicate the daily data file, where the dd parameter is a number
120 representing the day of the month.
121
122 /proc contains various files with system statistics.
123
125 Sebastien Godard (sysstat <at> orange.fr)
126
128 sar(1), sa1(8), sa2(8), sadf(1), sysstat(5)
129
130 http://pagesperso-orange.fr/sebastien.godard/
131
132
133
134Linux JUNE 2013 SADC(8)