forked from sysstat/sysstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iconfig
executable file
·235 lines (204 loc) · 6.76 KB
/
iconfig
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#!/bin/sh
#@(#) Configuration script for sysstat
# (C) 2000-2014 Sebastien GODARD (sysstat <at> orange.fr)
ASK="sh build/Ask.sh"
echo ; echo
echo Welcome to sysstat\'s Interactive Configuration script!
echo
echo This script enables you to set the parameters value used by ./configure.
echo Please enter the value for the parameters listed below.
echo Press Return to tell ./configure to use the default value or to try to guess the proper one.
echo "Defaut value for yes/no questions is no (parameter is NOT set)."
echo You can enter a ? to display a help message at any time...
echo
# Syntax: Ask <QUESTION> <PARM> <TEXT_FILE>
# Installation directory
PREFIX=`${ASK} 'Installation directory:' "--prefix" "prefix"`
if [ "${PREFIX}" != "" ]; then
PREFIX="--prefix=${PREFIX} "
fi
# sadc directory
SA_LIB_DIR=`${ASK} 'sadc directory:' "sa_lib_dir" "sa_lib_dir"`
if [ "${SA_LIB_DIR}" != "" ]; then
SA_LIB_DIR="sa_lib_dir=${SA_LIB_DIR} "
fi
# System Activity directory
SA_DIR=`${ASK} 'System activity directory:' "sa_dir" "sa_dir"`
if [ "${SA_DIR}" != "" ]; then
SA_DIR="sa_dir=${SA_DIR} "
fi
# sysstat configuration directory
SYSCONFIG_DIR=`${ASK} 'sysstat configuration directory:' "conf_dir" "conf_dir"`
if [ "${SYSCONFIG_DIR}" != "" ]; then
SYSCONFIG_DIR="conf_dir=${SYSCONFIG_DIR} "
fi
# Clean sa directory
CLEAN_SA_DIR=`${ASK} 'Clean system activity directory? (y/n)' "--enable-clean-sa-dir" "clean-sa-dir"`
if [ "${CLEAN_SA_DIR}" = "y" ]; then
CLEAN_SA_DIR="--enable-clean-sa-dir "
else
CLEAN_SA_DIR=""
echo "Parameter --enable-clean-sa-dir is NOT set"
fi
# National Language Support
NLS=`${ASK} 'Disable National Language Support (NLS)? (y/n)' "--disable-nls" "nls"`
if [ "${NLS}" = "y" ]; then
NLS="--disable-nls "
else
NLS=""
echo "Parameter --disable-nls is NOT set"
fi
# Sensors support
SENSORS=`${ASK} 'Disable sensors support? (y/n)' "--disable-sensors" "sensors"`
if [ "${SENSORS}" = "y" ]; then
SENSORS="--disable-sensors "
else
SENSORS=""
echo "Parameter --disable-sensors is NOT set"
fi
# sa2 processes data file of the day before
YESTERDAY=`${ASK} 'sa2 uses daily data file of the day before? (y/n)' "--enable-yesterday" "yesterday"`
if [ "${YESTERDAY}" = "y" ]; then
YESTERDAY="--enable-yesterday "
else
YESTERDAY=""
echo "Parameter --enable-yesterday is NOT set"
fi
# Data history to keep by sa2
HISTORY=`${ASK} 'Number of daily data files to keep:' "history" "history"`
if [ "${HISTORY}" != "" ]; then
HISTORY="history=${HISTORY} "
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
COMPRESSAFTER="compressafter=${COMPRESSAFTER} "
fi
# Preallocation factor
PREALLOC_ANSWER=`${ASK} 'Preallocation factor value:' "prealloc" "prealloc"`
if [ "${PREALLOC_ANSWER}" != "" ]; then
PREALLOC_ANSWER="prealloc=${PREALLOC_ANSWER} "
fi
# Manual page group
MAN=`${ASK} 'Group for manual pages:' "man_group" "man_group"`
if [ "${MAN}" != "" ]; then
MAN="man_group=${MAN} "
fi
# Don't set attributes on files being installed
IGNORE_FILE_ATTR=`${ASK} 'Do not set attributes on files being installed? (y/n)' "--disable-file-attr" "ignore-file-attr"`
if [ "${IGNORE_FILE_ATTR}" = "y" ]; then
IGNORE_FILE_ATTR="--disable-file-attr "
else
IGNORE_FILE_ATTR=""
echo "Parameter --disable-file-attr is NOT set"
fi
# Crontab
CRON=`${ASK} 'Set crontab to start sar automatically? (y/n)' "--enable-install-cron" "install-cron"`
if [ "${CRON}" = "y" ]; then
CRON="--enable-install-cron "
else
CRON=""
echo "Parameter --enable-install-cron is NOT set"
fi
if [ "${CRON}" != "" ];
then
CRON_OWNER=`${ASK} 'Crontab owner:' "cron_owner" "cron_owner"`
if [ "${CRON_OWNER}" != "" ]; then
CRON="${CRON}cron_owner=${CRON_OWNER} "
fi
fi
if [ "${CRON}" != "" ];
then
CRON_INTERVAL=`${ASK} 'Crontab sampling interval (in minutes):' "cron_interval" "cron_interval"`
if [ "${CRON_INTERVAL}" != "" ]; then
CRON="${CRON}cron_interval=${CRON_INTERVAL} "
fi
fi
if [ "${CRON}" != "" ];
then
COLL_ALL=`${ASK} 'Should sadc collect optional activities? (y/n)' "--enable-collect-all" "collect-all"`
if [ "${COLL_ALL}" = "y" ]; then
CRON="${CRON}--enable-collect-all "
else
echo "Parameter --enable-collect-all is NOT set"
fi
fi
if [ "${CRON}" != "" -a "${COLL_ALL}" != "y" ];
then
# Optional args for sadc
SADC_OPT=`${ASK} 'Options to be passed to sadc:' "sadc_options" "sadc_options"`
else
SADC_OPT=
fi
if [ "${CRON}" != "" ];
then
# rc directory
RCDIR=`${ASK} 'rc directory:' "rcdir" "rcdir"`
if [ "${RCDIR}" != "" ]; then
RCDIR="rcdir=${RCDIR} "
fi
fi
if [ "${CRON}" != "" ];
then
# Only copy files
COPY_ONLY=`${ASK} 'Only copy files when installing sysstat? (y/n)' "--enable-copy-only" "copy-only"`
if [ "${COPY_ONLY}" = "y" ]; then
COPY_ONLY="--enable-copy-only "
else
COPY_ONLY=""
echo "Parameter --enable-copy-only is NOT set"
fi
fi
# Compress manual pages
COMPRESSMANPG=`${ASK} 'Compress manual pages? (y/n)' "--enable-compress-manpg" "compress-manpg"`
if [ "${COMPRESSMANPG}" = "y" ]; then
COMPRESSMANPG="--enable-compress-manpg "
else
COMPRESSMANPG=""
echo "Parameter --enable-compress-manpg is NOT set"
fi
# Install documentation
INSTALL_DOC=`${ASK} 'Skip documentation installation? (y/n)' "--disable-documentation" "install-doc"`
if [ "${INSTALL_DOC}" = "y" ]; then
INSTALL_DOC="--disable-documentation "
else
INSTALL_DOC=""
echo "Parameter --disable-documentation is NOT set"
fi
# Debug mode
DEBUGINFO=`${ASK} 'Debug mode support? (y/n)' "--enable-debuginfo" "debuginfo"`
if [ "${DEBUGINFO}" = "y" ]; then
DEBUGINFO="--enable-debuginfo "
else
DEBUGINFO=""
echo "Parameter --enable-debuginfo is NOT set"
fi
# Install isag script
INSTALL_ISAG=`${ASK} 'Install isag script? (y/n)' "--enable-install-isag" "install-isag"`
if [ "${INSTALL_ISAG}" = "y" ]; then
INSTALL_ISAG="--enable-install-isag "
else
INSTALL_ISAG=""
echo "Parameter --enable-install-isag is NOT set"
fi
# Strip object files
STRIP=`${ASK} 'Do not strip object files? (y/n)' "--disable-stripping" "stripping"`
if [ "${STRIP}" = "y" ]; then
STRIP="--disable-stripping "
else
STRIP=""
echo "Parameter --disable-stripping is NOT set"
fi
echo
echo -n "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR}"
if [ "${SADC_OPT}" != "" ];
then
echo -n "sadc_options=\"${SADC_OPT}\""
fi
echo "${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS}${STRIP}${COPY_ONLY}"
echo
./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${CLEAN_SA_DIR}${NLS} \
${YESTERDAY}${HISTORY}${COMPRESSAFTER}${PREALLOC_ANSWER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR} \
sadc_options="${SADC_OPT}" ${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${INSTALL_ISAG}${SENSORS} \
${STRIP}${COPY_ONLY}