From 8ec4cbe3b24fcda4eac98be1101db78e195cd747 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Fri, 16 Jun 2017 12:51:33 +1000 Subject: [PATCH] Add a check before running the sysstat script 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 --- shell/sysstat.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/sysstat.sh b/shell/sysstat.sh index 03cab6dc..d90061c0 100644 --- a/shell/sysstat.sh +++ b/shell/sysstat.sh @@ -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" -- 2.16.6