Add a check before running the sysstat script 22/5222/1
authorAnil Belur <abelur@linuxfoundation.org>
Fri, 16 Jun 2017 02:51:33 +0000 (12:51 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Fri, 16 Jun 2017 02:51:33 +0000 (12:51 +1000)
Systat is not enabled by default on Ubuntu, which requires
this check for projects which have not configured sysstat in
their provisioning scripts.

Change-Id: Idcde47ab389ff2b0bb2f5d43ee716a4a5c926fd0
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
shell/sysstat.sh

index 03cab6d..d90061c 100644 (file)
@@ -15,6 +15,11 @@ OS=$(facter operatingsystem)
 case "$OS" in
     Ubuntu)
         SYSSTAT_PATH="/var/log/sysstat"
+
+        # Dont run the script when systat is not enabled by default
+        if ! grep --quiet 'ENABLED="true"' "/etc/default/sysstat"; then
+            exit 0
+        fi
     ;;
     CentOS|RedHat)
         SYSSTAT_PATH="/var/log/sa"