From d5d3a6e3b79cc931313af733a3542e6077a02f27 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 2 Jan 2023 11:11:49 -0600 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dsmon.sh b/dsmon.sh index 3ae5d15..f0c8ed2 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -111,13 +111,16 @@ CHECK(){ checkhost=$(CHECK_HOST ${host_ip[$hostid]}) if [ "${checkhost}" != "false" ]; then + declare -A host_limits hostlimits=(${host_limits[${hostid}]}) for hl in ${hostlimits[@]}; do - echo $hl + hlname=$(echo $hl | cut -d ":" -f1) + hllim=$(echo $hl | cut -d ":" -f2) + echo "$hlname - $hllim" done - - for x in "${!hostlimits[@]}"; do printf "[%s]=%s\n" "$x" "${hostlimits[$x]}" ; done + echo + #for x in "${!hostlimits[@]}"; do printf "[%s]=%s\n" "$x" "${hostlimits[$x]}" ; done # 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}) @@ -199,7 +202,7 @@ CHECK(){ # echo -e "${idsCL[Cyan]} ${DRIVE}${spcA}:${idsCL[$fs_status_color]} ${DRIVEINFO_FREE[$DRIVE]} GB Free${spcB}${DRIVEINFO_FREEPER[$DRIVE]}%${spcC}(${DRIVEINFO_TOT[$DRIVE]} GB Total)${idsCL[Default]}" # done - unset DRIVEINFO_TOT DRIVEINFO_FREE DRIVEINFO_FREEPER DRIVES DRIVEINFO + unset DRIVEINFO_TOT DRIVEINFO_FREE DRIVEINFO_FREEPER DRIVES DRIVEINFO host_limits else echo -e "${idsCL[Yellow]} ${host_name[$hostid]} is down${idsCL[Default]}"