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