Update dsmon.sh

This commit is contained in:
2023-07-04 20:55:09 -05:00
parent 059d779819
commit 783f5e500b

View File

@@ -315,9 +315,6 @@ GETCRONTABS(){
for hostid in "${!host_ip[@]}"; do
checkhost=$(CHECK_HOST ${host_ip[$hostid]})
if [ "${checkhost}" != "false" ]; then
if ! ssh -tq root@${host_ip[$hostid]} command -v sshpass > /dev/null; then
ssh -tq root@${host_ip[$hostid]} apt install -yq sshpass > /dev/null 2>&1
fi
echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Gathering Crontabs${idsCL[Default]}${idsST[Reset]}"
ssh -tq root@${host_ip[$hostid]} dsmon get-crontab ${rtpsswd}
else
@@ -333,6 +330,9 @@ GETCRONTABS(){
}
GETCRONTAB(){
if ! command -v sshpass > /dev/null; then
apt install -yq sshpass > /dev/null 2>&1
fi
hostname=$(hostname)
crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' nm_crontab_user@10.10.10.50 "cat > /opt/idssys/nodemgmt/crontabs/${hostname}.crontab"