From: Sebastien Godard Date: Thu, 10 May 2012 20:03:02 +0000 (+0200) Subject: Added option --enable-collect-all to configure script. X-Git-Tag: v10.0.5~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80ad981d2f904c5c3a4de431f7987d4465457dcb;p=sysstat Added option --enable-collect-all to configure script. This option tells sadc to collect all possible activities, including optional ones. --- diff --git a/CHANGES b/CHANGES index 95153af..6b2f560 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,9 @@ xxxx/xx/xx: Version 10.0.5 - Sebastien Godard (sysstat orange.fr) various reports displayed by sadf. * XSD document updated: Added a maxOccurs indicator for the timestamp element. + * Added option --enable-collect-all to configure script. + This option tells sadc to collect all possible activities, + including optional ones. * [Peter Schiffer]: Set exit code to 0 for sa2 shell script. * iostat and sadc manual pages updated. * FAQ updated. diff --git a/build/collect-all b/build/collect-all new file mode 100644 index 0000000..af01193 --- /dev/null +++ b/build/collect-all @@ -0,0 +1,8 @@ + +Answer y if you want sadc to collect all possible activities. This is +equivalent to passing option "-S XALL" to sadc, and as a consequence +all optional activities are collected (read sadc(8) manual page to +knwow which activities are optional). +Default answer is n: Optional activities are NOT collected to prevent +data files from growing too large. + diff --git a/configure b/configure index f06808e..4ba80bd 100755 --- a/configure +++ b/configure @@ -641,6 +641,7 @@ STRIP DFLAGS WITH_DEBUG INSTALL_DOC +COLLECT_ALL REM_CHOWN QUOTE CRON_COUNT @@ -748,6 +749,7 @@ enable_compress_manpg enable_install_isag enable_clean_sa_dir enable_install_cron +enable_collect_all enable_documentation enable_debuginfo enable_stripping @@ -1400,6 +1402,7 @@ Optional Features: --enable-install-isag install isag script --enable-clean-sa-dir clean system activity directory --enable-install-cron install a crontab to start sar + --enable-collect-all collect all possible activities --disable-documentation do not install documentation --enable-debuginfo enable debug output (--debuginfo option) --disable-stripping do not strip object files @@ -7326,6 +7329,7 @@ echo . # --enable-yesterday tell sa2 to use "yesterday" data files # --disable-man-group ignore man_group variable value # --enable-install-cron tell sysstat to install cron scripts +# --collect-all tell sadc to collect all possible data # --enable-clean-sa-dir clean system activity directory # --enable-compress-manpg compress manual pages # --enable-install-isag install isag script @@ -7643,7 +7647,7 @@ fi $as_echo "$AUX_CSD" >&6; } -# Crontab +# Start crontab { $as_echo "$as_me:$LINENO: checking whether cron should start sar automatically" >&5 $as_echo_n "checking whether cron should start sar automatically... " >&6; } # Check whether --enable-install-cron was given. @@ -7664,6 +7668,7 @@ fi $as_echo "$AUX_CRON" >&6; } +# Crontab owner CUSR="root" if test $INSTALL_CRON = "y"; then { $as_echo "$as_me:$LINENO: checking crontab owner" >&5 @@ -7697,6 +7702,7 @@ $as_echo "$CRON_OWNER" >&6; } REM_CHOWN=$CHOWN fi +# Crontab interval { $as_echo "$as_me:$LINENO: checking crontab interval" >&5 $as_echo_n "checking crontab interval... " >&6; } @@ -7709,6 +7715,27 @@ $as_echo_n "checking crontab interval... " >&6; } $as_echo "$CRON_INTERVAL" >&6; } CRON_INTERVAL_SEC=`expr ${CRON_INTERVAL} \* 60` CRON_COUNT=`expr 60 / ${CRON_INTERVAL}` + +# Check whether sadc should collect all possible activities + { $as_echo "$as_me:$LINENO: checking whether sadc should collect all possible activities" >&5 +$as_echo_n "checking whether sadc should collect all possible activities... " >&6; } + # Check whether --enable-collect-all was given. +if test "${enable_collect_all+set}" = set; then + enableval=$enable_collect_all; COLLECT_ALL=$enableval +else + COLLECT_ALL=n=n +fi + + if test $COLLECT_ALL != "yes"; then + COLLECT_ALL="" + AUX_COLL=no + else + COLLECT_ALL="-S XALL" + AUX_COLL=yes + fi + { $as_echo "$as_me:$LINENO: result: $AUX_COLL" >&5 +$as_echo "$AUX_COLL" >&6; } + else CRON_OWNER="root" SU_C_OWNER="" @@ -7717,6 +7744,7 @@ else CRON_INTERVAL=10 CRON_INTERVAL_SEC=600 CRON_COUNT=6 + COLLECT_ALL="" fi @@ -7726,6 +7754,7 @@ fi + # Check whether documentation should be installed { $as_echo "$as_me:$LINENO: checking whether documentation should be installed" >&5 $as_echo_n "checking whether documentation should be installed... " >&6; } diff --git a/configure.in b/configure.in index 60e7e3e..e629fdd 100644 --- a/configure.in +++ b/configure.in @@ -121,6 +121,7 @@ echo . # --enable-yesterday tell sa2 to use "yesterday" data files # --disable-man-group ignore man_group variable value # --enable-install-cron tell sysstat to install cron scripts +# --collect-all tell sadc to collect all possible data # --enable-clean-sa-dir clean system activity directory # --enable-compress-manpg compress manual pages # --enable-install-isag install isag script @@ -391,7 +392,7 @@ fi AC_MSG_RESULT($AUX_CSD) AC_SUBST(CLEAN_SA_DIR) -# Crontab +# Start crontab AC_MSG_CHECKING(whether cron should start sar automatically) AC_ARG_ENABLE(install-cron, AC_HELP_STRING([--enable-install-cron], @@ -407,6 +408,7 @@ fi AC_MSG_RESULT($AUX_CRON) AC_SUBST(INSTALL_CRON) +# Crontab owner CUSR="root" if test $INSTALL_CRON = "y"; then AC_MSG_CHECKING(crontab owner) @@ -436,6 +438,7 @@ if test $INSTALL_CRON = "y"; then REM_CHOWN=$CHOWN fi +# Crontab interval AC_MSG_CHECKING(crontab interval) AC_ARG_VAR([cron_interval],[crontab interval]) if test x$cron_interval = x""; then @@ -446,6 +449,22 @@ if test $INSTALL_CRON = "y"; then AC_MSG_RESULT($CRON_INTERVAL) CRON_INTERVAL_SEC=`expr ${CRON_INTERVAL} \* 60` CRON_COUNT=`expr 60 / ${CRON_INTERVAL}` + +# Check whether sadc should collect all possible activities + AC_MSG_CHECKING(whether sadc should collect all possible activities) + AC_ARG_ENABLE(collect-all, + AC_HELP_STRING([--enable-collect-all], + [collect all possible activities]), + COLLECT_ALL=$enableval,COLLECT_ALL=n=n) + if test $COLLECT_ALL != "yes"; then + COLLECT_ALL="" + AUX_COLL=no + else + COLLECT_ALL="-S XALL" + AUX_COLL=yes + fi + AC_MSG_RESULT($AUX_COLL) + else CRON_OWNER="root" SU_C_OWNER="" @@ -454,6 +473,7 @@ else CRON_INTERVAL=10 CRON_INTERVAL_SEC=600 CRON_COUNT=6 + COLLECT_ALL="" fi AC_SUBST(CRON_OWNER) AC_SUBST(SU_C_OWNER) @@ -462,6 +482,7 @@ AC_SUBST(CRON_INTERVAL_SEC) AC_SUBST(CRON_COUNT) AC_SUBST(QUOTE) AC_SUBST(REM_CHOWN) +AC_SUBST(COLLECT_ALL) # Check whether documentation should be installed AC_MSG_CHECKING(whether documentation should be installed) diff --git a/iconfig b/iconfig index dbc7201..d639a93 100755 --- a/iconfig +++ b/iconfig @@ -128,6 +128,16 @@ then 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}" != "" ]; then # rc directory diff --git a/sa1.in b/sa1.in index e10af5c..cdd8b2f 100644 --- a/sa1.in +++ b/sa1.in @@ -1,12 +1,16 @@ #!/bin/sh # @SA_LIB_DIR@/sa1 -# (C) 1999-2011 Sebastien Godard (sysstat orange.fr) +# (C) 1999-2012 Sebastien Godard (sysstat orange.fr) # #@(#) @PACKAGE_NAME@-@PACKAGE_VERSION@ #@(#) sa1: Collect and store binary data in system activity data file. # + +# Set default value for some variables. +# Used only if ${SYSCONFIG_DIR}/sysstat doesn't exist! HISTORY=0 SADC_OPTIONS="" + SYSCONFIG_DIR=@SYSCONFIG_DIR@ [ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat if [ ${HISTORY} -gt 28 ] diff --git a/sysstat.sysconfig.in b/sysstat.sysconfig.in index 54dcef9..25cc673 100644 --- a/sysstat.sysconfig.in +++ b/sysstat.sysconfig.in @@ -10,5 +10,5 @@ COMPRESSAFTER=@COMPRESSAFTER@ # Parameters for the system activity data collector (see sadc manual page) # which are used for the generation of log files. -SADC_OPTIONS="" +SADC_OPTIONS="@COLLECT_ALL@"