Merge "Add a check before running the sysstat script"
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Tue, 27 Jun 2017 18:58:20 +0000 (18:58 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Tue, 27 Jun 2017 18:58:20 +0000 (18:58 +0000)
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"