Update dsmon.sh
This commit is contained in:
10
dsmon.sh
10
dsmon.sh
@@ -171,8 +171,8 @@ RUN_CHECK(){
|
||||
touch /tmp/dscheck.${hostname}.running
|
||||
hostid=${host_ids[$hostname]}
|
||||
# if [ "${1}" != "report" ]; then
|
||||
echo -e "${idsST[Bold]}"; DIVIDER false lightCyan 85
|
||||
echo -e "${idsCL[LightCyan]} ${host_name[$hostid]} - Drive Space Check${idsCL[Default]}"
|
||||
printf "${idsST[Bold]}\n"; DIVIDER false lightCyan 85
|
||||
printf "${idsCL[LightCyan]} ${host_name[$hostid]} - Drive Space Check${idsCL[Default]}\n"
|
||||
DIVIDER false lightCyan 85
|
||||
# fi
|
||||
|
||||
@@ -243,7 +243,7 @@ RUN_CHECK(){
|
||||
c=0; cw=10; spcB=''; spc2=`expr ${cw} - 4`; until [ $c = ${spc2} ]; do spcB="${spcB} "; c=`expr $c + 1`; done
|
||||
c=0; cw=10; spcC=''; spc3=`expr ${cw} - 5`; until [ $c = ${spc3} ]; do spcC="${spcC} "; c=`expr $c + 1`; done
|
||||
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]}"
|
||||
printf "${idsST[Reset]}${idsCL[White]} DRIVE${spcA} FREE GB${spcB}FREE %${spcC}TOTAL GB${spcD}WARN % / CRIT %${idsCL[Default]}\n"
|
||||
# pf="%-20s %10s %10s %12s %50s\n"
|
||||
# printf "${pf}" "${idsCL[White]}DRIVE" "FREE GB" "FREE %" "TOTAL GB" "WARN % / CRIT %${idsCL[Default]}"
|
||||
# fi
|
||||
@@ -285,7 +285,7 @@ RUN_CHECK(){
|
||||
D_WARNING_LEVEL=$(printf "%0.2f" $(jq -n 100-${WARNING_LEVEL}))
|
||||
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]}"
|
||||
printf "${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]}\n"
|
||||
|
||||
# [ "${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]}"
|
||||
|
||||
@@ -312,7 +312,7 @@ RUN_CHECK(){
|
||||
|
||||
else
|
||||
# [ "${1}" != "report" ] &&
|
||||
echo -e "${idsCL[Yellow]} ${host_name[$hostid]} is down${idsCL[Default]}"; echo
|
||||
printf "${idsCL[Yellow]} ${host_name[$hostid]} is down${idsCL[Default]}\n"; echo
|
||||
fi
|
||||
mv /tmp/dscheck.${hostname}.running /tmp/dscheck.${hostname}.done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user