Update dsmon.sh

This commit is contained in:
2025-06-14 13:48:21 -05:00
parent e87808087a
commit e1c74787b5

View File

@@ -152,7 +152,9 @@ CHECK(){
unbuffer bash -c "/usr/local/bin/dsmon runcheck '${hostname}'" > /tmp/dscheck.${hostname}.results &
# unbuffer RUN_CHECK "$hostname" > /tmp/dscheck.${hostname}.results &
((started_hosts++))
[ "${1}" != "report" ] && printf "\r${idsCL[LightCyan]}${MSG}${spc}: Started on %d of %d hosts ...${idsCL[Default]}" "${started_hosts}" "${#hostnames_sort[@]}"
[ "${1}" != "report" ] &&
printf "\r${idsCL[LightCyan]}${MSG}${spc}: Started on %d of %d hosts %s${idsCL[Default]}" "${started_hosts}" "${#hostnames_sort[@]}" $([[ "$started_hosts" -lt "${#hostnames_sort[@]}" ]] && echo " ..." || echo "")
done
[ "${1}" != "report" ] && echo -e "\r\033[2K${idsCL[LightCyan]}${MSG}${spc}: ${idsCL[LightGreen]}Done${idsCL[Default]}"
@@ -171,7 +173,8 @@ CHECK(){
((nc_count++))
fi
done
[ "${1}" != "report" ] && printf "\r${idsCL[LightCyan]}Completed on %d of %d hosts ...${idsCL[Default]}\n" "${nc_count}" "${#hostnames_sort[@]}"
[ "${1}" != "report" ] && printf "\r${idsCL[LightCyan]}Completed on %d of %d hosts %s${idsCL[Default]}\n" "${nc_count}" "${#hostnames_sort[@]}" $([[ "$nc_count" -lt "${#hostnames_sort[@]}" ]] && echo " ..." || echo "")
if [ $(($(date +%s)-scanstart)) -gt 300 ]; then
SENDNOTICE "DSmon Scan Stuck" "DSmon Check scan has been running for 10mins, klling all bash...." 1