Update dsmon.sh
This commit is contained in:
6
dsmon.sh
6
dsmon.sh
@@ -100,7 +100,7 @@ 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' hostnames_sort=($(sort <<<"${hostnames_sort[*]}")); unset IFS
|
IFS=$'\n' hostnames_sort=($(sort -r <<<"${hostnames_sort[*]}")); unset IFS
|
||||||
|
|
||||||
#for hostid in "${!host_ip[@]}"; do
|
#for hostid in "${!host_ip[@]}"; do
|
||||||
for hostname in "${hostnames_sort[@]}"; do
|
for hostname in "${hostnames_sort[@]}"; do
|
||||||
@@ -167,7 +167,9 @@ CHECK(){
|
|||||||
|
|
||||||
for DRIVE in "${DRIVES[@]}"; do
|
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]}))
|
WARNING_LEVEL=$(printf "%0.2f" $(jq -n 100-${host_limits_tmp[$DRIVE]}))
|
||||||
CRITICAL_LEVEL=$(printf "%0.2f" $(jq -n $WARNING_LEVEL-$WARNING_LEVEL/2))
|
CRITICAL_LEVEL=$(printf "%0.2f" $(jq -n $WARNING_LEVEL-$WARNING_LEVEL/2))
|
||||||
|
|||||||
Reference in New Issue
Block a user