Update dsmon.sh

This commit is contained in:
2023-07-04 22:54:53 -05:00
parent ef62682b9f
commit aa079b505e

View File

@@ -321,7 +321,7 @@ GETCRONTABS(){
for hostid in "${!host_ip[@]}"; do
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]}"
echo -en "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Gathering Crontabs ... ${idsCL[Default]}${idsST[Reset]}"
ssh -tq root@${host_ip[$hostid]} dsmon get-crontab ${rtpsswd}
else
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
@@ -354,6 +354,7 @@ GETCRONTAB(){
while read host hostname; do
if [ "${host}" != "host" ]; then
crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' nm_crontab_user@${nmip} "cat > ${DS_CRONTAB_FOLDER}/${host}.crontab"
echo -e "${idsCL[Green]} done${idsCL[Default]}"
fi
done <<< $(MYSQL_PWD="sysmoninsert" mysql -h mysqldb.scity.us -P 3306 -u sysmoninsert -e "SELECT host,hostname FROM servermonitor.hosts WHERE id=${SERVERMON_ID} ORDER BY host ASC")
fi