diff --git a/dsmon.sh b/dsmon.sh index 712e000..4b9f6eb 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -100,7 +100,7 @@ CHECK(){ fi done <<< $(MYSQL_PWD="sysmoninsert" mysql -h mysqldb.scity.us -P 3306 -u sysmoninsert -e "SELECT id,host,ip,limits FROM servermonitor.hosts") - IFS=$'\n' hostnames_sort=($(sort <<<"${hostnames_sort[*]}")); unset IFS + IFS=$'\n' hostnames_sort=($(sort -r <<<"${hostnames_sort[*]}")); unset IFS #for hostid in "${!host_ip[@]}"; do for hostname in "${hostnames_sort[@]}"; do @@ -167,7 +167,9 @@ CHECK(){ for DRIVE in "${DRIVES[@]}"; do - [ "${host_limits_tmp[$DRIVE]}" = "" ] && ${host_limits_tmp[$DRIVE]}=81 + [ "${host_limits_tmp[$DRIVE]}" = "" ] && host_limits_tmp[$DRIVE]=81 + + WARNING_LEVEL=$(printf "%0.2f" $(jq -n 100-${host_limits_tmp[$DRIVE]})) CRITICAL_LEVEL=$(printf "%0.2f" $(jq -n $WARNING_LEVEL-$WARNING_LEVEL/2))