Update dsmon.sh

This commit is contained in:
2023-01-02 09:38:44 -06:00
parent 703ac5fd45
commit d0ad43dcf2

View File

@@ -111,7 +111,7 @@ CHECK(){
checkhost=$(CHECK_HOST ${host_ip[$hostid]}) checkhost=$(CHECK_HOST ${host_ip[$hostid]})
if [ "${checkhost}" != "false" ]; then if [ "${checkhost}" != "false" ]; then
DRIVEINFO=$(ssh root@${host_ip[$hostid]} df -BM | grep -vE '^Filesystem|tmpfs|cdrom|@|ram|loop|udev|veeamimage|nvme|localhost|shm|mmcblk|-volume|Music|media-data|Software' | awk '{ print $1 " " $2 " " $4 }') DRIVEINFO=$(ssh root@${host_ip[$hostid]} df -BM | grep -vE '^Filesystem|tmpfs|cdrom|@|ram|loop|udev|veeamimage|nvme|localhost|shm|mmcblk|overlay|-volume|Music|media-data|Software' | awk '{ print $1 " " $2 " " $4 }')
DRIVEINFO=(${DRIVEINFO}) DRIVEINFO=(${DRIVEINFO})
NUMDRIVES=$((${#DRIVEINFO[@]} / 3)) NUMDRIVES=$((${#DRIVEINFO[@]} / 3))
@@ -134,12 +134,12 @@ CHECK(){
systempartition=true systempartition=true
elif [ "${ia}" = "mmcblk0p1" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then elif [ "${ia}" = "mmcblk0p1" ] && [ ${DRIVEINFO[$((${ii}+1))]//M/} -lt 1024 ]; then
systempartition=true systempartition=true
elif [ "${ia}" != "overlay" ]; then else
#echo "${ia};${ib};${ic}" systempartition=false
DRIVE_INFO+=("${ia};${ib};${ic}")
fi fi
if [ $systempartition = false ]; then
if (( $(bc <<<"$dfreeper <= 15") )); then if (( $(bc <<<"$dfreeper <= 15") )); then
fs_status='error' fs_status='error'
fs_status_color='Red' fs_status_color='Red'
@@ -165,6 +165,8 @@ CHECK(){
echo -e "${idsCL[$fs_status_color]} ${dname}${spcA}: ${dfree}GB Free${spcB}- ${dfreeper}% -${idsCL[Default]}" echo -e "${idsCL[$fs_status_color]} ${dname}${spcA}: ${dfree}GB Free${spcB}- ${dfreeper}% -${idsCL[Default]}"
fi
done done
else else