Update dsmon.sh

This commit is contained in:
2023-07-04 22:47:57 -05:00
parent 42854b5585
commit 78af33c3f8

View File

@@ -349,7 +349,12 @@ GETCRONTAB(){
nmip=
fi
[ "${nmip}" != "" ] && crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' nm_crontab_user@${nmip} "cat > ${DS_CRONTAB_FOLDER}/${hostname}.crontab"
while read host hostname; do
echo "$host-$hostname"
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")
# [ "${nmip}" != "" ] && crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' nm_crontab_user@${nmip} "cat > ${DS_CRONTAB_FOLDER}/${hostname}.crontab"
}