Skip to content

Commit

Permalink
Fix: USED_MEM use correct row
Browse files Browse the repository at this point in the history
  • Loading branch information
nevercast authored Apr 21, 2020
1 parent b9511e7 commit df1177e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server-monitoring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
Expand Down

0 comments on commit df1177e

Please sign in to comment.