Update dsmon.sh

This commit is contained in:
2023-01-02 15:41:57 -06:00
parent 7fba03dd8c
commit 128bcfda60

View File

@@ -211,7 +211,7 @@ CHECK(){
fs_status='CRITICAL'
fs_status_color='RedBold'
elif (( $(bc <<<"$dfreeper <= ${WARNING_LEVEL}") )); then
elif (( $(bc <<<"${DRIVEINFO_FREEPER[$DRIVE]} <= ${WARNING_LEVEL}") )); then
fs_status='Warning'
fs_status_color='Yellow'
else
@@ -220,7 +220,7 @@ CHECK(){
fi
[ "${1}" != "report" ] && echo -e "${idsCL[Cyan]} ${DRIVE}${spcA}:${idsCL[$fs_status_color]} ${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}" != "" ] && [ "${fs_status}" != "Normal" ] && [ "${1}" = "report" ]; then
if [ "${ALERT_EMAIL}" != "" ] && [ "${fs_status}" != "Normal" ]; then
echo -e "${host_name[$hostid]} - (${host_ip[$hostid]})\n\n${DRIVE} : ${DRIVEINFO_FREE[$DRIVE]}GB out of ${DRIVEINFO_TOT[$DRIVE]}GB Free (${DRIVEINFO_FREEPER[$DRIVE]}%)\n\n$(date)" | mail -s "Free Space ${fs_status}: '${host_name[$hostid]}'" ${ALERT_EMAIL}
fi