Update dsmon.sh
This commit is contained in:
4
dsmon.sh
4
dsmon.sh
@@ -95,8 +95,12 @@ CHECK(){
|
|||||||
fi
|
fi
|
||||||
done <<< $(MYSQL_PWD="sysmoninsert" mysql -h mysqldb.scity.us -P 3306 -u sysmoninsert -e "SELECT id,host,ip,limits FROM servermonitor.hosts")
|
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
|
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
|
# for hostid in "${!host_ip[@]}"; do
|
||||||
|
|||||||
Reference in New Issue
Block a user