Update dsmon.sh
This commit is contained in:
34
dsmon.sh
34
dsmon.sh
@@ -142,23 +142,25 @@ CHECK(){
|
|||||||
|
|
||||||
nc_count=0; completed=false; scanstart=$(date +%s)
|
nc_count=0; completed=false; scanstart=$(date +%s)
|
||||||
until [ "${completed}" == "true" ]; do
|
until [ "${completed}" == "true" ]; do
|
||||||
for host in /tmp/dscheck.*.done >/dev/null 2>&1; do
|
if [ -f /tmp/dscheck.*.done ]; then
|
||||||
NTS=$(grep -oP '(?<=dscheck.).*?(?=.done)' <<< "${nodestatus}")
|
for host in /tmp/dscheck.*.done >/dev/null 2>&1; do
|
||||||
if [ "${NTS}" != "*" ]; then
|
NTS=$(grep -oP '(?<=dscheck.).*?(?=.done)' <<< "${nodestatus}")
|
||||||
hoststatus=$(cat /tmp/dscheck.${NTS}.results)
|
if [ "${NTS}" != "*" ]; then
|
||||||
[ "${hoststatus}" != "" ] && echo -e "${hoststatus}"
|
hoststatus=$(cat /tmp/dscheck.${NTS}.results)
|
||||||
rm -f /tmp/dscheck.${NTS}.*
|
[ "${hoststatus}" != "" ] && echo -e "${hoststatus}"
|
||||||
((nc_count++))
|
rm -f /tmp/dscheck.${NTS}.*
|
||||||
|
((nc_count++))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ $(($(date +%s)-scanstart)) -gt 600 ]; then
|
||||||
|
SENDNOTICE "NMG Scan Stuck" "DSmon Check scan has been running for 10mins, klling all bash...." 1
|
||||||
|
killall bash
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ${nc_count} -eq ${#hostnames_sort[@]} ]; then
|
||||||
|
completed=true
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
if [ $(($(date +%s)-scanstart)) -gt 600 ]; then
|
|
||||||
SENDNOTICE "NMG Scan Stuck" "DSmon Check scan has been running for 10mins, klling all bash...." 1
|
|
||||||
killall bash
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ ${nc_count} -eq ${#hostnames_sort[@]} ]; then
|
|
||||||
completed=true
|
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
sleep 1s
|
sleep 1s
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user