Update dsmon.sh
This commit is contained in:
4
dsmon.sh
4
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]}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user