--- /dev/null
+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.
+Default value is 0, meaning that sa2 will generate reports files immediately.
IGNORE_FILE_ATTRIBUTES
MAN_GROUP
man_group
+DELAY_RANGE
+delay_range
COMPRESSAFTER
compressafter
HISTORY
conf_file
history
compressafter
+delay_range
man_group
cron_owner
cron_interval
compressafter
number of days after which data files are compressed (default
value is 10)
+ delay_range maximum delay (in seconds) to wait before sa2 script generates
+ its reports
man_group group for manual pages
cron_owner crontab owner
cron_interval
# conf_dir sysstat configuration directory (default is /etc/sysconfig)
# conf_file sysstat configuration file (default is sysstat)
# history number of daily datafiles to keep (default value is 7)
+# delay_range maximum delay (in seconds) to wait before sa2 script generates its reports
# compressafter number of days after which datafiles are compressed
# man_group group for man pages
# cron_owner crontab owner
$as_echo "$COMPRESSAFTER" >&6; }
+# Random delay to wait before sa2 script runs
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking random delay to wait before sa2 script runs" >&5
+$as_echo_n "checking random delay to wait before sa2 script runs... " >&6; }
+
+if test x$delay_range = x""; then
+ DELAY_RANGE=0
+else
+ DELAY_RANGE=$delay_range
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DELAY_RANGE" >&5
+$as_echo "$DELAY_RANGE" >&6; }
+
+
# Manual page group
grep ^man: /etc/group >/dev/null 2>&1
if test $? = 0; then
# conf_dir sysstat configuration directory (default is /etc/sysconfig)
# conf_file sysstat configuration file (default is sysstat)
# history number of daily datafiles to keep (default value is 7)
+# delay_range maximum delay (in seconds) to wait before sa2 script generates its reports
# compressafter number of days after which datafiles are compressed
# man_group group for man pages
# cron_owner crontab owner
AC_MSG_RESULT($COMPRESSAFTER)
AC_SUBST(COMPRESSAFTER)
+# Random delay to wait before sa2 script runs
+AC_MSG_CHECKING(random delay to wait before sa2 script runs)
+AC_ARG_VAR([delay_range],[maximum delay (in seconds) to wait before sa2 script generates its reports])
+if test x$delay_range = x""; then
+ DELAY_RANGE=0
+else
+ DELAY_RANGE=$delay_range
+fi
+AC_MSG_RESULT($DELAY_RANGE)
+AC_SUBST(DELAY_RANGE)
+
# Manual page group
grep ^man: /etc/group >/dev/null 2>&1
if test $? = 0; then
HISTORY="history=${HISTORY} "
fi
+# Random delay before sa2 script generates its reports files
+DELAY_RANGE=`${ASK} 'Maximum delay in seconds to wait before sa2 script runs:' "delay_range" "delay_range"`
+if [ "${DELAY_RANGE}" != "" ]; then
+ DELAY_RANGE="delay_range=${DELAY_RANGE} "
+fi
+
# Delay after which datafiles are to be compressed
COMPRESSAFTER=`${ASK} 'Number of days after which sar datafiles must be compressed:' "compressafter" "compressafter"`
if [ "${COMPRESSAFTER}" != "" ]; then
echo
echo -n "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${SYSCONFIG_FILE} \
-${CLEAN_SA_DIR}${NLS}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${USE_CROND}${RCDIR}"
+${CLEAN_SA_DIR}${NLS}${HISTORY}${DELAY_RANGE}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR} \
+${CRON}${USE_CROND}${RCDIR}"
if [ "${SADC_OPT}" != "" ];
then
echo -n "sadc_options=\"${SADC_OPT}\""
./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${SYSCONFIG_FILE} \
${CLEAN_SA_DIR}${NLS} \
-${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${USE_CROND}${RCDIR} \
+${HISTORY}${DELAY_RANGE}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${USE_CROND}${RCDIR} \
sadc_options="${SADC_OPT}" ${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${SENSORS} \
${PCP}${STRIP}${COPY_ONLY}
-.TH SYSSTAT 5 "JULY 2018" Linux "Linux User's Manual" -*- nroff -*-
+.TH SYSSTAT 5 "MAY 2020" Linux "Linux User's Manual" -*- nroff -*-
.SH NAME
sysstat \- sysstat configuration file.
.SH DESCRIPTION
.B ZIP
variable.
+.TP
+.B DELAY_RANGE
+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.
+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
ZIP="@ZIP@"
UMASK=0022
ENDIR=@SAR_DIR@
+DELAY_RANGE=@DELAY_RANGE@
# Read configuration file, overriding variables set above
[ -r ${SYSCONFIG_DIR}/${SYSCONFIG_FILE} ] && . ${SYSCONFIG_DIR}/${SYSCONFIG_FILE}
umask ${UMASK}
+# Wait for a random delay if requested
+if [ ${DELAY_RANGE} -gt 0 ]
+then
+ RANDOM=$$
+ DELAY=$((${RANDOM}%${DELAY_RANGE}))
+ sleep ${DELAY}
+fi
+
[ -d ${SA_DIR} ] || SA_DIR=@SA_DIR@
# if YESTERDAY=no then today's summary is generated
# Set this variable to false to disable reports generation.
#REPORTS=false
+# Tell sa2 to wait for a random delay in the range 0 .. ${DELAY_RANGE} before
+# executing. 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.
+# Set this variable to 0 to make sa2 generate reports files immediately.
+DELAY_RANGE=@DELAY_RANGE@
+
# The sa1 and sa2 scripts generate system activity data and report files in
# the @SA_DIR@ directory. By default the files are created with umask 0022
# and are therefore readable for all users. Change this variable to restrict