Update dsmon.sh

This commit is contained in:
2023-07-04 20:32:06 -05:00
parent a67997ea04
commit f68fd437ba

View File

@@ -243,7 +243,7 @@ CHECK(){
end=`date +%s` end=`date +%s`
runtime=$((end-start)) runtime=$((end-start))
echo "runtime: ${runtime}" echo "Script Runtime: ${runtime}"
} }
SETUPSSH(){ SETUPSSH(){
@@ -267,6 +267,8 @@ SETUPSSH(){
} }
RUNCMD(){ RUNCMD(){
start=`date +%s`
declare -A host_ip declare -A host_ip
declare -A host_name declare -A host_name
@@ -286,9 +288,17 @@ RUNCMD(){
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}" echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
fi fi
done done
echo
end=`date +%s`
runtime=$((end-start))
echo "Script Runtime: ${runtime}"
echo
} }
GETCRONTABS(){ GETCRONTABS(){
start=`date +%s`
declare -A host_ip declare -A host_ip
declare -A host_name declare -A host_name
@@ -314,9 +324,17 @@ GETCRONTABS(){
echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}" echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"
fi fi
done done
echo
end=`date +%s`
runtime=$((end-start))
echo "Script Runtime: ${runtime}"
echo
} }
GETCRONTAB(){ GETCRONTAB(){
crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' root@10.10.10.50 'cat > /opt/idssys/nodemgmt/crontabs/`hostname`.crontab' crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' root@10.10.10.50 'cat > /opt/idssys/nodemgmt/crontabs/`hostname`.crontab'
} }
case $action in case $action in