Update dsmon.sh
This commit is contained in:
3
dsmon.sh
3
dsmon.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user