Update dsmon.sh

This commit is contained in:
2023-01-02 12:38:35 -06:00
parent 3e5474baac
commit 2534e8768b

View File

@@ -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))