Debian Codegraph @

upstream/debian-unstable/man5/sysstat.5

raw
1 .\" sysstat manual page - (C) 2020 Sebastien Godard (sysstat <at> orange.fr)
2 .TH SYSSTAT 5 "AUGUST 2023" Linux "Linux User's Manual" -*- nroff -*-
3 .SH NAME
4 sysstat \- sysstat configuration file.
5
6 .SH DESCRIPTION
7 This file is read by
8 .BR "sa1" "(8) and " "sa2" "(8) shell scripts from the sysstat's set of tools."
9 It consists of a sequence of shell variable assignments used to
10 configure sysstat logging.
11 The variables and their meanings are:
12 .TP
13 .B COMPRESSAFTER
14 Number of days after which daily data files are to be compressed.
15 The compression program is given in the
16 .BR "ZIP " "variable."
17 .TP
18 .B DELAY_RANGE
19 .RB "Tell " "sa2"
20 script to wait for a random delay in the indicated range before running.
21 This delay is expressed in seconds, and is aimed at preventing a massive I/O burst
22 at the same time on VM sharing the same storage area.
23 .RB "A value of 0 means that " "sa2"
24 script will generate its reports files immediately.
25 .TP
26 .B HISTORY
27 The number of days during which a daily data file or a report
28 should be kept. Data files or reports older than this number of
29 days will be removed by the
30 .BR "sa2" "(8) shell script."
31 Data files and reports are normally saved in the /var/log/sysstat directory,
32 under the name
33 .IR "saDD " "(for data files) or " "sarDD " "(for reports), where the " "DD"
34 parameter indicates the current day.
35
36 The number of files actually kept in the /var/log/sysstat directory may be
37 slightly higher than the
38 .BR "HISTORY " "value due to the way the " "sa2"
39 script figures out which files are to be removed (see below "How the
40 .BR "sa2" "(8) script applies " "HISTORY"
41 value"). Using a value of 28 keeps a whole month's worth of data. If you set
42 .B HISTORY
43 to a value greater than 28 then you should consider using
44 .BR "sadc" "'s option " "\-D"
45 to prevent older data files from being overwritten (see
46 .BR "sadc" "(8)"
47 manual page). In this latter case data files are named
48 .IR "saYYYYMMDD " "and reports " "sarYYYYMMDD" ", where"
49 .IR "YYYY " "stands for the current year, " "MM " "for the current month and " "DD"
50 for the current day.
51
52 How the
53 .BR "sa2" "(8) script applies " "HISTORY " "value"
54
55 .RB "The " "sa2"
56 script uses the
57 .BR "find " "command with the " "\-mtime " "option to figure"
58 out which files are to be removed. The
59 .BR "find " "command interprets this value"
60 as "N 24 hour periods", ignoring any fractional part. This means that the
61 last modified time of a given
62 .IR "sa[r]DD " "data or report file, using a"
63 .B HISTORY
64 of 1, has to have been modified at least two days ago before it will be
65 removed. And for a
66 .BR "HISTORY " "of 28 that would mean 29 days ago."
67
68 .RB "To figure out how a " "HISTORY"
69 of 28 is applied in practice, we need to consider that the
70 .BR "sa2 " "script that issues the " "find " "command to remove the"
71 old files typically runs just before midnight on a given system, and since
72 the first record from
73 .B sadc
74 can also be written to the previous day's data file
75 (thereby moving its modification time up a bit), the
76 .B sa2
77 script will leave
78 30 files untouched. So for a setting of 28, and counting the data file of
79 the current day, there will always be 31 files (or 30 files, depending on the
80 number of days in a month) in the /var/log/sysstat directory during the majority
81 of a given day. E.g.:
82
83 April 30th: 31 files (Apr 30th-1st, Mar 31th)
84 .br
85 May 1st: 30 files (May 1st, Apr 30th-2nd)
86
87 Yet we can note the following exceptions (as inspected at Noon of the given day):
88
89 February 28th: 31 files (Feb 28th-1st, Jan 31st, 30th & 29th)
90 .br
91 March 1st: 30 files (Mar 1st, Feb 28th-2nd, Jan 31st & 30th)
92 .br
93 March 2nd: 29 files (Mar 1st & 2nd, Feb 28th-3rd, Jan. 31st)
94 .br
95 March 3rd: 28 files (Mar 1st-3rd, Feb 28th-4th)
96 .br
97 March 4th - March 28th: 28 files
98 .br
99 March 29th: 29 files
100 .br
101 March 30th: 30 files
102 .br
103 March 31st: 31 files
104
105 (Determining the number of files in March on a leap year is left as an
106 exercise for the reader).
107
108 Things are simpler if you use the
109 .IR "sa[r]YYYYMMDD " "name format."
110 Apply the same logic as above in this case and you will find that there
111 are always
112 .BR "HISTORY " "+ 3 files in the"
113 .IR /var/log/sa
114 directory during the majority of a given day.
115 .TP
116 .B REPEAT_HEADER
117 Maximum number of lines after which a header will be inserted in the report
118 generated by
119 .BR "sa2" " script. By default there is only a header at the beginning of"
120 each report and it is not repeated afterwards.
121 .TP
122 .B REPORTS
123 Set this variable to
124 .BR "false " "to prevent the " "sa2"
125 script from generating reports (the
126 .IR "sarDD " "files)."
127 .TP
128 .B SA_DIR
129 Directory where the standard system activity daily data and report files
130 are saved. Its default value is
131 .IR "/var/log/sysstat" "."
132 .TP
133 .B SADC_OPTIONS
134 Options that should be passed to
135 .BR "sadc" "(8)."
136 With these options (see
137 .BR "sadc" "(8)"
138 manual page), you can select some additional data which are going to be saved in
139 daily data files.
140 These options are used only when a new data file is created. They will be
141 ignored with an already existing one.
142 .TP
143 .B UMASK
144 .RB "The " "sa1" " and " "sa2"
145 scripts generate system activity data and report files in the
146 .IR /var/log/sa
147 directory. By default the files are created with umask 0022
148 and are therefore readable for all users. Change this variable to restrict
149 the permissions on the files (e.g. use 0027 to adhere to more strict
150 security standards).
151 .TP
152 .B YESTERDAY
153 .RB "By default " "sa2"
154 script generates yesterday's summary, since the
155 .BR "cron " "job"
156 usually runs right after midnight. If you want
157 .B sa2
158 to generate the summary of the same day (for example when cron
159 job runs at 23:53) set this variable to
160 .BR "no" "."
161 .TP
162 .B ZIP
163 Program used to compress data and report files.
164
165 .SH FILE
166 .I /etc/sysstat/sysstat
167
168 .SH AUTHOR
169 Sebastien Godard (sysstat <at> orange.fr)
170
171 .SH SEE ALSO
172 .BR "sadc" "(8), " "sa1" "(8), " "sa2" "(8)"
173 .PP
174 .I https://github.com/sysstat/sysstat
175 .br
176 .I https://sysstat.github.io/