From e508010364eaf644f8d158b3b79071f0de88fd21 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 5 Jul 2025 14:06:13 -0500 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsmon.sh b/dsmon.sh index 05b7b4d..6ec2b9c 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -543,7 +543,7 @@ GETCRONTABS(){ checkhost=$(CHECK_HOST ${host_ip[$hostid]}) if [ "${checkhost}" != "false" ]; then echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Gathering Crontabs, and copycerts.sh if it exists ... ${idsCL[Default]}${idsST[Reset]}" - ${SSHCMD} root@${host_ip[$hostid]} dsmon get-crontab ${rtpsswd} & + ${SSHCMD} root@${host_ip[$hostid]} dsmon get-crontab ${rtpsswd} #& else echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}" fi @@ -567,7 +567,7 @@ GETCRONTAB(){ # echo -e "${SERVERMON_ID}) ${host} : ${hostname}\nmysqlip=${mysqlip}\n" crontab -l | sshpass -p${1} ${SSHCMD} -o 'StrictHostKeyChecking no' nm_crontab_user@${nmip} "cat > ${DS_CRONTAB_FOLDER}/${host}.crontab" if [ -f /opt/copycerts.sh ]; then - cat /opt/copycerts.sh | sshpass -p${1} ${SSHCMD} -o 'StrictHostKeyChecking no' nm_crontab_user@${nmip} "cat > ${DS_COPYCERTS_FOLDER}/${host}_copycerts.sh" + sshpass -p${1} scp /opt/copycerts.sh nm_crontab_user@${nmip}:${DS_COPYCERTS_FOLDER}/${host}_copycerts.sh fi fi done <<< $(MYSQL_PWD="sysmoninsert" ${mysqlcmd} ${mysql_conn} -u sysmoninsert -e "SELECT host,hostname FROM servermonitor.hosts WHERE id=${SERVERMON_ID}")