Update dsmon.sh

This commit is contained in:
2023-07-04 22:50:45 -05:00
parent f5fc8fb48a
commit d4ed476899

View File

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