diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-11-18 14:28:59 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-11-18 14:28:59 +0100 |
commit | a891c68d86a9956f26821ec84e12f8f1a852c56b (patch) | |
tree | 6bec801cfd975ee56020e54680971bb331aa3f7d | |
parent | 38c0a899844e16483b21d96973f6bf21436dc4a2 (diff) | |
download | monitoring_custom-a891c68d86a9956f26821ec84e12f8f1a852c56b.tar.gz |
check_mem deciaml places
-rwxr-xr-x | check_mem | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -32,13 +32,14 @@ while read line; do break done <<< $(free | tail -n -2) -PERCENT_USED=$(echo "scale=2; $USED / $TOTAL * 100 / 1" | bc -l) -PERCENT_USED=${PERCENT_USED%.*} +PERCENT_USED=$(echo "scale=4; $USED / $TOTAL * 100 " | bc -l) +PERCENT_USED=${PERCENT_USED%00} +PERCENT_USED_INT=${PERCENT_USED%.*} -if [ $PERCENT_USED -ge $CRIT ]; then +if [ $PERCENT_USED_INT -ge $CRIT ]; then RET=2 echo -n "Memory CRITICAL: " -elif [ $PERCENT_USED -ge $WARN ]; then +elif [ $PERCENT_USED_INT -ge $WARN ]; then RET=1 echo -n "Memory WARNING: " else |