Update dsmon.sh

This commit is contained in:
2023-01-02 13:11:32 -06:00
parent ee73a15a0f
commit b078ef0501

View File

@@ -107,25 +107,7 @@ CHECK(){
hostid=${host_ids[$hostname]}
echo -e "${idsST[Bold]}"; DIVIDER false lightCyan 100
echo -e "${idsCL[LightCyan]} ${host_name[$hostid]} - Drive Space Check${idsCL[Default]}"
DIVIDER false lightCyan 100;
c=0; cw=40; spcA=''
spc1=`expr ${cw} - 5`
until [ $c = ${spc1} ]; do spcA="${spcA} "; c=`expr $c + 1`; done
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=12; spcD=''
spc4=`expr ${cw} - 1`
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]}"
DIVIDER false lightCyan 100
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
if [ "${checkhost}" != "false" ]; then
@@ -182,6 +164,20 @@ CHECK(){
# echo
# for x in "${!DRIVEINFO_FREEPER[@]}"; do printf "[%s]=%s\n" "$x" "${DRIVEINFO_FREEPER[$x]}" ; done
# echo
c=0; cw=40; spcA=''
spc1=`expr ${cw} - 5`
until [ $c = ${spc1} ]; do spcA="${spcA} "; c=`expr $c + 1`; done
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=12; spcD=''
spc4=`expr ${cw} - 1`
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]}"
for DRIVE in "${DRIVES[@]}"; do