Update dsmon.sh

This commit is contained in:
2023-01-02 14:03:15 -06:00
parent 5f1d5c374f
commit 6c5c25fa96

View File

@@ -208,13 +208,13 @@ CHECK(){
fs_status='error'
fs_status_color='Red'
echo -e "${idsCL[Cyan]} ${DRIVE}${spcA}:${idsCL[RedBold]} ${DRIVEINFO_FREE[$DRIVE]} GB${spcB}${DRIVEINFO_FREEPER[$DRIVE]}%${spcC}${DRIVEINFO_TOT[$DRIVE]} GB${idsST[Reset]}${spcD}${idsCL[Cyan]}( ${idsCL[Yellow]}${WARNING_LEVEL}%${idsCL[Cyan]} / ${idsCL[Red]}${CRITICAL_LEVEL}%${idsCL[Cyan]} )${idsCL[Default]}"
#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
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 <= ${WARNING_LEVEL}") )); then
fs_status='warn'
fs_status_color='Yellow'
echo -e "${idsCL[Cyan]} ${DRIVE}${spcA}:${idsCL[$fs_status_color]} ${DRIVEINFO_FREE[$DRIVE]} GB${spcB}${DRIVEINFO_FREEPER[$DRIVE]}%${spcC}${DRIVEINFO_TOT[$DRIVE]} GB${spcD}${idsCL[Cyan]}( ${idsCL[Yellow]}${WARNING_LEVEL}%${idsCL[Cyan]} / ${idsCL[Red]}${CRITICAL_LEVEL}%${idsCL[Cyan]} )${idsCL[Default]}"
#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
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
else
fs_status=''