Update dsmon.sh

This commit is contained in:
2023-01-02 11:23:40 -06:00
parent 8e5c3304c1
commit 9a6891a44a

View File

@@ -170,14 +170,12 @@ CHECK(){
WARNING_LEVEL=$(printf "%0.2f" $(jq -n 100-${host_limits_tmp[$DRIVE]}))
CRITICAL_LEVEL=$(printf "%0.2f" $(jq -n $WARNING_LEVEL-$WARNING_LEVEL/2))
echo "warn=$WARNING_LEVEL - crit=$CRITICAL_LEVEL"
if (( $(bc <<<"${DRIVEINFO_FREEPER[$DRIVE]} <= 15") )); then
if (( $(bc <<<"${DRIVEINFO_FREEPER[$DRIVE]} <= ${CRITICAL_LEVEL}") )); then
fs_status='error'
fs_status_color='Red'
#if [ "${ALERT_EMAIL}" != "" ]; then echo -e "${host_name[$hostid]} - (${host_ip[$hostid]})\n${DRIVE} : ${DRIVEINFO_FREE[$DRIVE]} GB free\t$(date)" | mail -s "Free Space Critical: '${host_name[$hostid]}'" ${ALERT_EMAIL}; fi
elif (( $(bc <<<"$dfreeper <= 25") )); then
elif (( $(bc <<<"$dfreeper <= ${WARNING_LEVEL}") )); then
fs_status='warn'
fs_status_color='Yellow'
#if [ "${ALERT_EMAIL}" != "" ]; then echo -e "${host_name[$hostid]} - (${host_ip[$hostid]})\n${DRIVE} : ${DRIVEINFO_FREE[$DRIVE]} GB free\t$(date)" | mail -s "Free Space Warning: '${host_name[$hostid]}'" ${ALERT_EMAIL}; fi