Update dsmon.sh

This commit is contained in:
2024-01-06 23:42:35 -06:00
parent 00fc33e3cd
commit d1ebfa544b

View File

@@ -136,6 +136,7 @@ CHECK(){
echo -en "${idsCL[LightCyan]}${MSG}${spc}: " echo -en "${idsCL[LightCyan]}${MSG}${spc}: "
#for hostid in "${!host_ip[@]}"; do #for hostid in "${!host_ip[@]}"; do
for hostname in "${hostnames_sort[@]}"; do for hostname in "${hostnames_sort[@]}"; do
until [ $(ls /tmp/dscheck.${hostname}.running 2>/dev/null | wc -l) -lt 2 ]; do tmp=tmp; done
RUN_CHECK ${hostname} > /tmp/dscheck.${hostname}.results 2>/dev/null & RUN_CHECK ${hostname} > /tmp/dscheck.${hostname}.results 2>/dev/null &
done done
echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}" echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}"
@@ -171,6 +172,7 @@ CHECK(){
RUN_CHECK(){ RUN_CHECK(){
hostname=${1} hostname=${1}
touch /tmp/dscheck.${hostname}.running
hostid=${host_ids[$hostname]} hostid=${host_ids[$hostname]}
# if [ "${1}" != "report" ]; then # if [ "${1}" != "report" ]; then
echo -e "${idsST[Bold]}"; DIVIDER false lightCyan 85 echo -e "${idsST[Bold]}"; DIVIDER false lightCyan 85
@@ -308,7 +310,7 @@ RUN_CHECK(){
# [ "${1}" != "report" ] && # [ "${1}" != "report" ] &&
echo -e "${idsCL[Yellow]} ${host_name[$hostid]} is down${idsCL[Default]}"; echo echo -e "${idsCL[Yellow]} ${host_name[$hostid]} is down${idsCL[Default]}"; echo
fi fi
touch /tmp/dscheck.${hostname}.done mv /tmp/dscheck.${hostname}.running /tmp/dscheck.${hostname}.done
} }
SETUPSSH(){ SETUPSSH(){