]> granicus.if.org Git - sysstat/commitdiff
Added option --enable-collect-all to configure script.
authorSebastien Godard <sysstat@orange.fr>
Thu, 10 May 2012 20:03:02 +0000 (22:03 +0200)
committerSebastien Godard <sysstat@orange.fr>
Sun, 13 May 2012 13:07:53 +0000 (15:07 +0200)
This option tells sadc to collect all possible activities,
including optional ones.

CHANGES
build/collect-all [new file with mode: 0644]
configure
configure.in
iconfig
sa1.in
sysstat.sysconfig.in

diff --git a/CHANGES b/CHANGES
index 95153afb890a38b771b8fa36d18e6a2b05f696ae..6b2f5609ac910536db66bf875296a49da85925ff 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,9 @@ xxxx/xx/xx: Version 10.0.5 - Sebastien Godard (sysstat <at> 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 (file)
index 0000000..af01193
--- /dev/null
@@ -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.
+
index f06808eba0008b73dbdfbe02592d6e86b227ff23..4ba80bd0025bdc3c335379f36ac739065eaa0a67 100755 (executable)
--- 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; }
index 60e7e3edc7eb6cb56c8736da5db35ada04e79af3..e629fddb33e8d9b0ea6f9cbf06e416e68cd19d89 100644 (file)
@@ -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 dbc7201465c715be322bde52f748f2b8f9a38ee0..d639a93a54a741cf628d1e04ddb69a09445b40fd 100755 (executable)
--- 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 e10af5c6530794255dc296c29b8cb1139f4c032f..cdd8b2f237d5f2e6ac7e416d0930a6ecfd00dc64 100644 (file)
--- a/sa1.in
+++ b/sa1.in
@@ -1,12 +1,16 @@
 #!/bin/sh
 # @SA_LIB_DIR@/sa1
-# (C) 1999-2011 Sebastien Godard (sysstat <at> orange.fr)
+# (C) 1999-2012 Sebastien Godard (sysstat <at> 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 ]
index 54dcef9019e9fc3ced855ae74fb9184e1581d187..25cc6734d06de4cbde658d66ebc1e549e5d576f3 100644 (file)
@@ -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@"