Merge pull request #1067 from alajko/monitorScript

more changes
pull/1068/head
alajko 6 years ago committed by GitHub
commit a2310f5cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      scripts/mystatus.sh

@ -24,17 +24,19 @@ while getopts "h" opt; do
esac
done
#cd $HOME
#check if you're in snych
heightStatus=$(grep otherHeight ./latest/validator*.log | egrep -o "myHeight(.*)([0-9]+)," | tail -n 1)
currentBlockHeight="otherHeight"
myBlockChainHeight="myHeight"
heightStatus=$(grep $currentBlockHeight ./latest/validator*.log | egrep -o $myBlockChainHeight"(.*)([0-9]+)," | tail -n 1)
# Which Shard
my_shard=$(egrep -o "shard\/[0-9]+" ./latest/validator*.log | tail -n 1)
my_shard=$(egrep -o "shardID\"\:[0-9]+" ./latest/validator*.log | tail -n 1 | cut -f2 -d ":")
# Which IP
ip=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
ip=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
bingos=$(grep -c "BINGO" ./latest/*log)
bingos=$(grep -c "BINGO" ./latest/validator*log)
# balances=$(./wallet.sh balances)
@ -42,6 +44,7 @@ status=$(tac ./latest/* | egrep -m1 'BINGO|HOORAY' | \
grep ViewID | \
python -c $'import datetime, sys, json;\nfor x in sys.stdin:\n y = json.loads(x); print "%10s %s %s" % (y.get("ViewID", "*" + str(y.get("myViewID", 0))), datetime.datetime.strftime(datetime.datetime.strptime(y["t"][:-4], "%Y-%m-%dT%H:%M:%S.%f") + datetime.timedelta(hours=-7), "%m/%d %H:%M:%S.%f"), y["ip"])')
lengthOfChain=$(cat $status | cut -f1 -d " ")
#sudo /sbin/ldconfig -v
#nodeVersion=$(LD_LIBRARY_PATH=$(pwd) ./harmony -version)
@ -51,11 +54,11 @@ status=$(tac ./latest/* | egrep -m1 'BINGO|HOORAY' | \
#echo "Your Node Version : "
LD_LIBRARY_PATH=$(pwd) ./harmony -version
echo "Your System Status : "$status
echo "Current Length of Chain : "$lengthOfChain
echo "Your Sync Status : "$heightStatus
echo "Your Shard : " $my_shard
echo "Your IP: " $ip
echo "Blocks Received : " $bingos
echo "Total Blocks Received After Syncing: " $bingos
echo "Your Rewards: "
./wallet.sh balances
Loading…
Cancel
Save