Update dsmon.sh

This commit is contained in:
2024-01-26 09:04:25 -06:00
parent f4b4bc2a4d
commit 278c0fc45e

View File

@@ -353,7 +353,7 @@ RUNCMD(){
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
if [ "${checkhost}" != "false" ]; then
echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Running command: ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}${idsCL[Default]}${idsST[Reset]}"
ssh -tq -o ConnectTimeout=1 -o ConnectionAttempts=1 root@${host_ip[$hostid]} ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}
ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${host_ip[$hostid]} ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}
else
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
fi
@@ -382,7 +382,7 @@ RUNCMD(){
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
if [ "${checkhost}" != "false" ]; then
echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Running command: ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}${idsCL[Default]}${idsST[Reset]}"
ssh -tq -o ConnectTimeout=1 -o ConnectionAttempts=1 root@${host_ip[$hostid]} ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}
ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${host_ip[$hostid]} ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}
else
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
fi
@@ -402,10 +402,9 @@ UPDATENODES(){
declare -A host_name
while read hostid hostname hostip hostlimits; do
echo "${hostid} - ${host} - ${hostname}"
if [ "$hostid" != "id" ]; then
echo -e "${idsCL[LightCyan]}Updating DSMON on '${hostname}'${idsCL[Default]}"
ssh -tq -o ConnectTimeout=1 -o ConnectionAttempts=1 root@$(echo $hostip | cut -d ";" -f1) "dsmon update"
ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@$(echo $hostip | cut -d ";" -f1) "dsmon update"
echo
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")
@@ -462,7 +461,7 @@ GETCRONTABS(){
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
if [ "${checkhost}" != "false" ]; then
# echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Gathering Crontabs ... ${idsCL[Default]}${idsST[Reset]}"
ssh -q -o ConnectTimeout=1 -o ConnectionAttempts=1 -t root@${host_ip[$hostid]} dsmon get-crontab ${rtpsswd} &
ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 -t root@${host_ip[$hostid]} dsmon get-crontab ${rtpsswd} &
else
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
fi