From 56cf676cc88fb6c58cd8627d101ca30b098ebea5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 14 Jun 2025 13:26:44 -0500 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dsmon.sh b/dsmon.sh index 00e9a94..6cb6e14 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -146,11 +146,13 @@ CHECK(){ c=0; cw=${C_CW}; spc=''; spc1=$(expr ${cw} - ${#MSG}); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done echo -en "${idsCL[LightCyan]}${MSG}${spc}: " fi + started_hosts=0 for hostname in "${hostnames_sort[@]}"; do while [ $(jobs -rp | wc -l) -ge 12 ]; do sleep 0.5; done unbuffer bash -c "/usr/local/bin/dsmon runcheck '${hostname}'" > /tmp/dscheck.${hostname}.results & # unbuffer RUN_CHECK "$hostname" > /tmp/dscheck.${hostname}.results & - printf "\r${idsCL[LightCyan]}${MSG}${spc}: Startedmon %d/%d hosts ..." "$(jobs -rp | wc -l)" "${#hostnames_sort[@]}" + ((started_hosts++)) + printf "\r${idsCL[LightCyan]}${MSG}${spc}: Started on %d/%d hosts ..." "${started_hosts}" "${#hostnames_sort[@]}" done [ "${1}" != "report" ] && echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}"