Update dsmon.sh

This commit is contained in:
2023-01-02 09:14:33 -06:00
parent 7bffae4848
commit 5f495e08eb

View File

@@ -95,8 +95,12 @@ 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' sorted=($(sort <<<"${host_name[*]}"))
unset IFS
for x in "${!host_name[@]}"; do printf "[%s]=%s\n" "$x" "${host_name[$x]}" ; done
echo
for x in "${!sorted[@]}"; do printf "[%s]=%s\n" "$x" "${sorted[$x]}" ; done
# for hostid in "${!host_ip[@]}"; do