summaryrefslogtreecommitdiffstats
path: root/upstream/fedora-40/man5/sysstat.5
blob: e31f6b314fc219335c9aac4c93149e87eb597368 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
.\" sysstat manual page - (C) 2020 Sebastien Godard (sysstat <at> orange.fr)
.TH SYSSTAT 5 "AUGUST 2023" Linux "Linux User's Manual" -*- nroff -*-
.SH NAME
sysstat \- sysstat configuration file.

.SH DESCRIPTION
This file is read by
.BR "sa1" "(8) and " "sa2" "(8) shell scripts from the sysstat's set of tools."
It consists of a sequence of shell variable assignments used to
configure sysstat logging.
The variables and their meanings are:
.TP
.B COMPRESSAFTER
Number of days after which daily data files are to be compressed.
The compression program is given in the
.BR "ZIP " "variable."
.TP
.B DELAY_RANGE
.RB "Tell " "sa2"
script to wait for a random delay in the indicated range before running.
This delay is expressed in seconds, and is aimed at preventing a massive I/O burst
at the same time on VM sharing the same storage area.
.RB "A value of 0 means that " "sa2"
script will generate its reports files immediately.
.TP
.B HISTORY
The number of days during which a daily data file or a report
should be kept. Data files or reports older than this number of
days will be removed by the
.BR "sa2" "(8) shell script."
Data files and reports are normally saved in the /var/log/sa directory,
under the name
.IR "saDD " "(for data files) or " "sarDD " "(for reports), where the " "DD"
parameter indicates the current day.

The number of files actually kept in the /var/log/sa directory may be
slightly higher than the
.BR "HISTORY " "value due to the way the " "sa2"
script figures out which files are to be removed (see below "How the
.BR "sa2" "(8) script applies " "HISTORY"
value"). Using a value of 28 keeps a whole month's worth of data. If you set
.B HISTORY
to a value greater than 28 then you should consider using
.BR "sadc" "'s option " "\-D"
to prevent older data files from being overwritten (see
.BR "sadc" "(8)"
manual page). In this latter case data files are named
.IR "saYYYYMMDD " "and reports " "sarYYYYMMDD" ", where"
.IR "YYYY " "stands for the current year, " "MM " "for the current month and " "DD"
for the current day.

How the
.BR "sa2" "(8) script applies " "HISTORY " "value"

.RB "The " "sa2"
script uses the
.BR "find " "command with the " "\-mtime " "option to figure"
out which files are to be removed. The
.BR "find " "command interprets this value"
as "N 24 hour periods", ignoring any fractional part. This means that the
last modified time of a given
.IR "sa[r]DD " "data or report file, using a"
.B HISTORY
of 1, has to have been modified at least two days ago before it will be
removed. And for a
.BR "HISTORY " "of 28 that would mean 29 days ago."

.RB "To figure out how a " "HISTORY"
of 28 is applied in practice, we need to consider that the
.BR "sa2 " "script that issues the " "find " "command to remove the"
old files typically runs just before midnight on a given system, and since
the first record from
.B sadc
can also be written to the previous day's data file
(thereby moving its modification time up a bit), the
.B sa2
script will leave
30 files untouched. So for a setting of 28, and counting the data file of
the current day, there will always be 31 files (or 30 files, depending on the
number of days in a month) in the /var/log/sa directory during the majority
of a given day.  E.g.:

April 30th: 31 files (Apr 30th-1st, Mar 31th)
.br
May 1st: 30 files (May 1st, Apr 30th-2nd)

Yet we can note the following exceptions (as inspected at Noon of the given day):

February 28th: 31 files (Feb 28th-1st, Jan 31st, 30th & 29th)
.br
March 1st: 30 files (Mar 1st, Feb 28th-2nd, Jan 31st & 30th)
.br
March 2nd: 29 files (Mar 1st & 2nd, Feb 28th-3rd, Jan. 31st)
.br
March 3rd: 28 files (Mar 1st-3rd, Feb 28th-4th)
.br
March 4th - March 28th: 28 files
.br
March 29th: 29 files
.br
March 30th: 30 files
.br
March 31st: 31 files

(Determining the number of files in March on a leap year is left as an
exercise for the reader).

Things are simpler if you use the
.IR "sa[r]YYYYMMDD " "name format."
Apply the same logic as above in this case and you will find that there
are always
.BR "HISTORY " "+ 3 files in the"
.IR /var/log/sa
directory during the majority of a given day.
.TP
.B REPEAT_HEADER
Maximum number of lines after which a header will be inserted in the report
generated by
.BR "sa2" " script. By default there is only a header at the beginning of"
each report and it is not repeated afterwards.
.TP
.B REPORTS
Set this variable to
.BR "false " "to prevent the " "sa2"
script from generating reports (the
.IR "sarDD " "files)."
.TP
.B SA_DIR
Directory where the standard system activity daily data and report files
are saved. Its default value is
.IR "/var/log/sa" "."
.TP
.B SADC_OPTIONS
Options that should be passed to
.BR "sadc" "(8)."
With these options (see
.BR "sadc" "(8)"
manual page), you can select some additional data which are going to be saved in
daily data files.
These options are used only when a new data file is created. They will be
ignored with an already existing one.
.TP
.B UMASK
.RB "The " "sa1" " and " "sa2"
scripts generate system activity data and report files in the
.IR /var/log/sa
directory. By default the files are created with umask 0022
and are therefore readable for all users. Change this variable to restrict
the permissions on the files (e.g. use 0027 to adhere to more strict
security standards).
.TP
.B YESTERDAY
.RB "By default " "sa2"
script generates yesterday's summary, since the
.BR "cron " "job"
usually runs right after midnight. If you want
.B sa2
to generate the summary of the same day (for example when cron
job runs at 23:53) set this variable to
.BR "no" "."
.TP
.B ZIP
Program used to compress data and report files.

.SH FILE
.I /etc/sysconfig/sysstat

.SH AUTHOR
Sebastien Godard (sysstat <at> orange.fr)

.SH SEE ALSO
.BR "sadc" "(8), " "sa1" "(8), " "sa2" "(8)"
.PP
.I https://github.com/sysstat/sysstat
.br
.I https://sysstat.github.io/