From f68fd437ba69574587c308eeb0335ab03a0316e8 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 4 Jul 2023 20:32:06 -0500 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dsmon.sh b/dsmon.sh index e953cce..2c61cf1 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -243,7 +243,7 @@ CHECK(){ end=`date +%s` runtime=$((end-start)) - echo "runtime: ${runtime}" + echo "Script Runtime: ${runtime}" } SETUPSSH(){ @@ -267,6 +267,8 @@ SETUPSSH(){ } RUNCMD(){ + start=`date +%s` + declare -A host_ip declare -A host_name @@ -286,9 +288,17 @@ RUNCMD(){ echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}" fi 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_name @@ -314,9 +324,17 @@ GETCRONTABS(){ echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}" fi done + + echo + end=`date +%s` + runtime=$((end-start)) + echo "Script Runtime: ${runtime}" + echo + } GETCRONTAB(){ crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' root@10.10.10.50 'cat > /opt/idssys/nodemgmt/crontabs/`hostname`.crontab' + } case $action in