From df1177e7406015d59689c511aae8da84769acc51 Mon Sep 17 00:00:00 2001 From: Josh Lloyd Date: Tue, 21 Apr 2020 13:16:58 +1200 Subject: [PATCH] Fix: USED_MEM use correct row https://github.com/Freemius/server-monitoring/issues/4 --- server-monitoring.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-monitoring.sh b/server-monitoring.sh index f30fcf7..94a18b1 100644 --- a/server-monitoring.sh +++ b/server-monitoring.sh @@ -194,7 +194,7 @@ get_cpu_usage () { get_memory_usage () { local TOTAL_MEM=$( free -m | awk 'NR==2{print $2}' ) - local USED_MEM=$( free -m | awk 'NR==3{print $3}' ) + local USED_MEM=$( free -m | awk 'NR==2{print $3}' ) local USED_MEM_PERCENTAGE=$( bc <<< "100 * $USED_MEM / $TOTAL_MEM" ) echo "${USED_MEM_PERCENTAGE}" }