update
This commit is contained in:
@@ -5,7 +5,7 @@ VERS=2.3.12-01262024
|
|||||||
DS_FOLDER=/opt/idssys/dsmon
|
DS_FOLDER=/opt/idssys/dsmon
|
||||||
DS_CRONTAB_FOLDER=/opt/idssys/nodemgmt/crontabs
|
DS_CRONTAB_FOLDER=/opt/idssys/nodemgmt/crontabs
|
||||||
|
|
||||||
noheader=" gettsip-node get-crontab update report updatenodes "
|
noheader=" gettsip-node get-crontabs get-crontab update report updatenodes "
|
||||||
|
|
||||||
|
|
||||||
if [ "${NM_NODEMANAGER}" != "" ]; then
|
if [ "${NM_NODEMANAGER}" != "" ]; then
|
||||||
|
|||||||
22
dsmon.sh
22
dsmon.sh
@@ -343,7 +343,7 @@ RUNCMD(){
|
|||||||
declare -A host_name
|
declare -A host_name
|
||||||
|
|
||||||
while read hostid hostname hostip hostlimits; do
|
while read hostid hostname hostip hostlimits; do
|
||||||
if [ "$hostid" != "id" ]; then
|
if [ "${hostname}" != "host" ]; then
|
||||||
host_ip[${hostid}]=$(echo $hostip | cut -d ";" -f1)
|
host_ip[${hostid}]=$(echo $hostip | cut -d ";" -f1)
|
||||||
host_name[${hostid}]=$hostname
|
host_name[${hostid}]=$hostname
|
||||||
fi
|
fi
|
||||||
@@ -372,20 +372,22 @@ RUNCMD(){
|
|||||||
declare -A host_name
|
declare -A host_name
|
||||||
|
|
||||||
while read hostid hostname hostip hostlimits; do
|
while read hostid hostname hostip hostlimits; do
|
||||||
if [ "$hostid" != "id" ]; then
|
if [ "${hostname}" != "host" ]; then
|
||||||
host_ip[${hostid}]=$(echo $hostip | cut -d ";" -f1)
|
host_ip[${hostid}]=$(echo $hostip | cut -d ";" -f1)
|
||||||
host_name[${hostid}]=$hostname
|
host_name[${hostid}]=$hostname
|
||||||
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")
|
||||||
|
|
||||||
for hostid in "${!host_ip[@]}"; do
|
for hostid in "${!host_ip[@]}"; do
|
||||||
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
|
# checkhost=$(CHECK_HOST ${host_ip[$hostid]})
|
||||||
if [ "${checkhost}" != "false" ]; then
|
# 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]}"
|
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=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}
|
if [ ! 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} ]; then
|
||||||
else
|
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
|
||||||
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
|
fi
|
||||||
fi
|
# else
|
||||||
|
# echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
|
||||||
|
# fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo
|
echo
|
||||||
@@ -402,7 +404,7 @@ UPDATENODES(){
|
|||||||
declare -A host_name
|
declare -A host_name
|
||||||
|
|
||||||
while read hostid hostname hostip hostlimits; do
|
while read hostid hostname hostip hostlimits; do
|
||||||
if [ "$hostid" != "id" ]; then
|
if [ "${hostname}" != "host" ]; then
|
||||||
echo -e "${idsCL[LightCyan]}Updating DSMON on '${hostname}'${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}Updating DSMON on '${hostname}'${idsCL[Default]}"
|
||||||
ssh -tq -o ConnectTimeout=3 -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
|
echo
|
||||||
@@ -461,7 +463,7 @@ GETCRONTABS(){
|
|||||||
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
|
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
|
||||||
if [ "${checkhost}" != "false" ]; then
|
if [ "${checkhost}" != "false" ]; then
|
||||||
# echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Gathering Crontabs ... ${idsCL[Default]}${idsST[Reset]}"
|
# echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Gathering Crontabs ... ${idsCL[Default]}${idsST[Reset]}"
|
||||||
ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 -t root@${host_ip[$hostid]} dsmon get-crontab ${rtpsswd} &
|
ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 -t root@${host_ip[$hostid]} dsmon get-crontab ${rtpsswd} &
|
||||||
else
|
else
|
||||||
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
|
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user