Update dsmon.sh

This commit is contained in:
2024-01-26 10:23:43 -06:00
parent e57f6ad30e
commit c6982a64b6

View File

@@ -350,7 +350,7 @@ RUNCMD(){
fi
done <<< $(MYSQL_PWD="sysmoninsert" mysql -h ${mysqlip} -u sysmoninsert -e "SELECT id,host,ip,limits FROM servermonitor.hosts WHERE disabled=0 ORDER BY host ASC")
nc_count=0; completed=false
nc_count=0; lcount=0; completed=false
until [ "${completed}" == "true" ]; do
for nodecmd in /tmp/.dsmon.runcmd.*.done; do
# HOST=$(grep -oP '(?<=runcmd.).*?(?=.done)' <<< "${nodecmd}")
@@ -369,11 +369,12 @@ RUNCMD(){
fi
done
if [ ${nc_count} -eq ${ncount} ]; then
echo -e "${idsCL[White]}Complete, the command was ran on all nodes\n"
[ ${lcount} -ne ${nc_count} ] && echo -e "${idsCL[White]}Complete, the command was ran on all nodes\n"
completed=true
break
fi
echo -e "${idsCL[White]}${nc_count} of ${ncount} completed ...\n"
lcount=${nc_count}
sleep 2s
done