From 3dc7edb2abf249cb71e25564ad17fdafaeeec3df Mon Sep 17 00:00:00 2001 From: Galadrin Date: Fri, 8 Sep 2023 11:43:37 +0200 Subject: [PATCH] ensure date match YYYY-MM-DD --- validate_health.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/validate_health.sh b/validate_health.sh index 53140a9..22e5ef5 100644 --- a/validate_health.sh +++ b/validate_health.sh @@ -228,7 +228,8 @@ fi if dpkg -s sysstat &>/dev/null; then echo -e "\nSystem CPU, Memory, Disk usage" - + # set the S_TIME_FORMAT variable to ensure the date format match YYYY-MM-DD + export S_TIME_FORMAT=ISO cpu_usage=$(mpstat | awk '$12 ~ /[0-9.]+/ { print 100 - $12 }') mem_usage=$(free -m | awk 'NR==2{printf "%.2f", $3*100/$2 }') disk_usage=$(df -h | awk '$NF=="/"{printf "%s", $5}' | tr -d %)