diff --git a/dsmon.sh b/dsmon.sh index 25a1f95..b20472e 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -112,18 +112,18 @@ CHECK(){ dtot=$(bc <<< "scale=2; ${DRIVEINFO[$((${ii}+1))]}/1024/10") dfree=$(bc <<< "scale=2; ${DRIVEINFO[$((${ii}+2))]}/1024/10") dfreeper=$(printf "%0.2f" $(jq -n ${dfree}/${dtot}*100)) - #dname=${ia//\/dev\/mapper\//} - #dname=${ia//\/dev\//} + dname=${ia//\/dev\/mapper\//} + dname=${ia//\/dev\//} if (( $(bc <<<"$dfreeper <= 15") )); then fs_status='error' fs_status_color='Red' - if [ "${ALERT_EMAIL}" != "" ]; then echo -e "${host_name[$hostid]} - (${host_ip[$hostid]})\n${dname} : ${dfree} MB 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${dname} : ${dfree} GB free\t$(date)" | mail -s "Free Space Critical: '${host_name[$hostid]}'" ${ALERT_EMAIL}; fi elif (( $(bc <<<"$dfreeper <= 25") )); then fs_status='warn' fs_status_color='Yellow' - if [ "${ALERT_EMAIL}" != "" ]; then echo -e "${host_name[$hostid]} - (${host_ip[$hostid]})\n${dname} : ${dfree} MB 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${dname} : ${dfree} GB free\t$(date)" | mail -s "Free Space Warning: '${host_name[$hostid]}'" ${ALERT_EMAIL}; fi else fs_status='' @@ -131,7 +131,7 @@ CHECK(){ fi - echo -e "${idsCL[$fs_status_color]} ${dname} - ${dfree} (${dfreeper}%) (total=$dtot) ${idsCL[Default]}" + echo -e "${idsCL[$fs_status_color]} ${dname} - ${dfree}GB Free - ${dfreeper}% -- (total=${dtot}GB) ${idsCL[Default]}" done