From 990565b49725e75f2bee1587417d544c0167b1f9 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 5 Jul 2023 21:14:17 -0500 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsmon.sh b/dsmon.sh index f3aed1e..c7a0f44 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -183,7 +183,7 @@ CHECK(){ c=0; cw=14; spcD=''; spc4=`expr ${cw} - 3`; until [ $c = ${spc4} ]; do spcD="${spcD} "; c=`expr $c + 1`; done echo -e "${idsST[Reset]}${idsCL[White]} DRIVE${spcA} FREE GB${spcB}FREE %${spcC}TOTAL GB${spcD}WARN % / CRIT %${idsCL[Default]}" # pf="%-20s %10s %10s %12s %50s\n" - # printf "${pf}" "${idsCLf[White]}DRIVE" "FREE GB" "FREE %" "TOTAL GB" "WARN % / CRIT %${idsCLf[Default]}" + # printf "${pf}" "${idsCL[White]}DRIVE" "FREE GB" "FREE %" "TOTAL GB" "WARN % / CRIT %${idsCL[Default]}" fi for DRIVE in "${DRIVES[@]}"; do @@ -224,7 +224,7 @@ CHECK(){ D_CRITICAL_LEVEL=$(printf "%0.2f" $(jq -n 100-${CRITICAL_LEVEL})) [ "${1}" != "report" ] && echo -e "${idsCL[Cyan]} ${DRIVEINFO_SHORTNAME[$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]}${D_WARNING_LEVEL}%${idsCL[Cyan]} / ${idsCL[RedBold]}${D_CRITICAL_LEVEL}%${idsST[Reset]}${idsCL[Cyan]} )${idsCL[Default]}" - # [ "${1}" != "report" ] && printf "${pf}" "${idsCLf[Cyan]}${DRIVEINFO_SHORTNAME[$DRIVE]}" "${idsCLf[$fs_status_color]}${DRIVEINFO_FREE[$DRIVE]} GB" "${DRIVEINFO_FREEPER[$DRIVE]}%" "${DRIVEINFO_TOT[$DRIVE]} GB" "${idsCLf[Cyan]}(${idsCLf[Default]}${D_WARNING_LEVEL}%${idsCLf[Cyan]}/${idsCLf[Default]}${D_CRITICAL_LEVEL}%${idsCLf[Cyan]})(${idsCLf[Yellow]}${D_WARNING_LEVEL}%${idsCLf[Cyan]}/${idsCLf[Red]}${D_CRITICAL_LEVEL}%${idsCLf[Cyan]})${idsCLf[Default]}" + # [ "${1}" != "report" ] && printf "${pf}" "${idsCL[Cyan]}${DRIVEINFO_SHORTNAME[$DRIVE]}" "${idsCL[$fs_status_color]}${DRIVEINFO_FREE[$DRIVE]} GB" "${DRIVEINFO_FREEPER[$DRIVE]}%" "${DRIVEINFO_TOT[$DRIVE]} GB" "${idsCL[Cyan]}(${idsCL[Default]}${D_WARNING_LEVEL}%${idsCL[Cyan]}/${idsCL[Default]}${D_CRITICAL_LEVEL}%${idsCL[Cyan]})(${idsCL[Yellow]}${D_WARNING_LEVEL}%${idsCL[Cyan]}/${idsCL[Red]}${D_CRITICAL_LEVEL}%${idsCL[Cyan]})${idsCL[Default]}" if [ "${fs_status}" != "Normal" ] && [ "${1}" = "report" ]; 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}