1SADC(8)                       Linux User's Manual                      SADC(8)
2
3
4

NAME

6       sadc - System activity data collector.
7

SYNOPSIS

9       /usr/lib64/sa/sadc  [  -C  comment ] [ -D ] [ -F ] [ -L ] [ -V ] [ -S {
10       DISK | INT | IPV6 | POWER | SNMP | XDISK | ALL |  XALL  [,...]  }  ]  [
11       interval [ count ] ] [ outfile ]
12

DESCRIPTION

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 (see below).  In this case, if the file already exists,
19       sadc will overwrite it if it is from a previous month.  By default sadc
20       collects  most  of  the  data available from the kernel.  But there are
21       also optional metrics, for which the relevant options must  be  explic‐
22       itly passed to sadc to be collected (see option -S below).
23
24       The  standard  system  activity  daily  data  file is named saDD unless
25       option -D is used, in which case its name  is  saYYYYMMDD,  where  YYYY
26       stands  for  the  current year, MM for the current month and DD for the
27       current day.  By default it is located in  the  /var/log/sa  directory.
28       Yet  it is possible to specify an alternate location for it: If outfile
29       is a directory (instead of a plain file) then it will be considered  as
30       the  directory  where the standard system activity daily data file will
31       be saved.
32
33       When the count parameter is not specified, sadc writes  its  data  end‐
34       lessly.   When both interval and count are not specified, and option -C
35       is not used, a dummy record, which is used at system  startup  to  mark
36       the  time when the counter restarts from 0, will be written.  For exam‐
37       ple, one of the system startup script may write the restart mark to the
38       daily data file by the command entry:
39
40       /usr/lib64/sa/sadc -
41
42       The  sadc  command  is intended to be used as a backend to the sar com‐
43       mand.
44
45       Note: The sadc command only reports on local activities.
46
47

OPTIONS

49       -C comment
50              When neither the interval nor the count  parameters  are  speci‐
51              fied,  this option tells sadc to write a dummy record containing
52              the specified comment string.  This comment  can  then  be  dis‐
53              played with option -C of sar.
54
55       -D     Use  saYYYYMMDD  instead of saDD as the standard system activity
56              daily data file name.
57
58       -F     The creation of outfile will be  forced.  If  the  file  already
59              exists  and  has  a format unknown to sadc then it will be trun‐
60              cated. This may be useful for daily data  files  created  by  an
61              older  version  of sadc and whose format is no longer compatible
62              with current one.
63
64       -L     sadc will try to get an exclusive lock  on  the  outfile  before
65              writing  to  it  or  truncating  it.  Failure to get the lock is
66              fatal, except in the case of trying to write a normal (i.e.  not
67              a  dummy  and not a header) record to an existing file, in which
68              case sadc will try again at the next interval. Usually, the only
69              reason  a  lock would fail would be if another sadc process were
70              also writing to the file. This can happen when cron is  used  to
71              launch  sadc.   If  the  system is under heavy load, an old sadc
72              might still be running when cron starts a new one. Without lock‐
73              ing,  this  situation  can result in a corrupted system activity
74              file.
75
76       -S { DISK | INT | IPV6 | POWER | SNMP | XDISK | ALL | XALL [,...] }
77              Specify which optional activities should be collected  by  sadc.
78              Some  activities are optional to prevent data files from growing
79              too large.  The DISK keyword indicates that sadc should  collect
80              data  for  block  devices.   The INT keyword indicates that sadc
81              should collect data for system  interrupts.   The  IPV6  keyword
82              indicates that IPv6 statistics should be collected by sadc.  The
83              POWER keyword indicates that sadc should collect  power  manage‐
84              ment  statistics.   The SNMP keyword indicates that SNMP statis‐
85              tics should be collected by sadc.  The ALL keyword is equivalent
86              to  specifying all the keywords above and therefore all previous
87              activities are collected.
88
89              The XDISK keyword is an extension to the DISK one and  indicates
90              that  partitions  and filesystems statistics should be collected
91              by sadc in addition to disk statistics. This option  works  only
92              with  kernels  2.6.25 and later.  The XALL keyword is equivalent
93              to specifying all the keywords above (including  keyword  exten‐
94              sions) and therefore all possible activities are collected.
95
96              Important  note:  The activities (including optional ones) saved
97              in an existing data file prevail over those selected with option
98              -S.   As  a consequence, appending data to an existing data file
99              will result in option -S being ignored.
100
101       -V     Print version number then exit.
102
103

ENVIRONMENT

105       The sadc command takes into account the following environment variable:
106
107
108       S_TIME_DEF_TIME
109              If this variable exists and its value is UTC then sadc will save
110              its  data  in  UTC time.  sadc will also use UTC time instead of
111              local time to determine the current daily data file  located  in
112              the /var/log/sa directory.
113

EXAMPLES

115       /usr/lib64/sa/sadc 1 10 /tmp/datafile
116              Write  10  records  of one second intervals to the /tmp/datafile
117              binary file.
118
119       /usr/lib64/sa/sadc -C Backup_Start /tmp/datafile
120              Insert the comment Backup_Start into the file /tmp/datafile.
121

BUGS

123       The /proc filesystem must be mounted for the sadc command to work.
124
125       All the statistics are not necessarily available, depending on the ker‐
126       nel  version used.  sadc assumes that you are using at least a 2.6 ker‐
127       nel.
128

FILES

130       /var/log/sa/saDD
131       /var/log/sa/saYYYYMMDD
132              The standard system activity daily data files and their  default
133              location.   YYYY stands for the current year, MM for the current
134              month and DD for the current day.
135
136       /proc and /sys contain various files with system statistics.
137

AUTHOR

139       Sebastien Godard (sysstat <at> orange.fr)
140

SEE ALSO

142       sar(1), sa1(8), sa2(8), sadf(1), sysstat(5)
143
144       http://pagesperso-orange.fr/sebastien.godard/
145
146
147
148Linux                            DECEMBER 2016                         SADC(8)
Impressum