Update dsmon.sh
This commit is contained in:
5
dsmon.sh
5
dsmon.sh
@@ -350,7 +350,7 @@ RUNCMD(){
|
|||||||
fi
|
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")
|
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
|
until [ "${completed}" == "true" ]; do
|
||||||
for nodecmd in /tmp/.dsmon.runcmd.*.done; do
|
for nodecmd in /tmp/.dsmon.runcmd.*.done; do
|
||||||
# HOST=$(grep -oP '(?<=runcmd.).*?(?=.done)' <<< "${nodecmd}")
|
# HOST=$(grep -oP '(?<=runcmd.).*?(?=.done)' <<< "${nodecmd}")
|
||||||
@@ -369,11 +369,12 @@ RUNCMD(){
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ ${nc_count} -eq ${ncount} ]; then
|
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
|
completed=true
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
echo -e "${idsCL[White]}${nc_count} of ${ncount} completed ...\n"
|
echo -e "${idsCL[White]}${nc_count} of ${ncount} completed ...\n"
|
||||||
|
lcount=${nc_count}
|
||||||
|
|
||||||
sleep 2s
|
sleep 2s
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user