monitor improvement

pull/1047/head
ak 5 years ago
parent c46dec3f5d
commit 90fbb3e07c
  1. 39
      scripts/monitor.sh

@ -13,20 +13,20 @@ Monitor Help:
Actions: Actions:
1. status - Generates a status report of your node 1. status - Generates a status report of your node
EOT EOT
exit 0 exit 0
} }
while getopts "h" opt; do while getopts "h" opt; do
case $opt in case $opt in
h) usage ;; h) usage ;;
*) usage ;; *) usage ;;
esac esac
done done
cd $HOME #cd $HOME
#check if you're in snych #check if you're in snych
heightStatus=$(grep otherHeight ./latest/validator-54.221.12.96-9000.log | egrep -o "myHeight(.*)([0-9]+)," | tail -n 1) heightStatus=$(grep otherHeight ./latest/validator*.log | egrep -o "myHeight(.*)([0-9]+)," | tail -n 1)
# Which Shard # Which Shard
my_shard=$(egrep -o "shard\/[0-9]+" ./latest/validator*.log | tail -n 1) my_shard=$(egrep -o "shard\/[0-9]+" ./latest/validator*.log | tail -n 1)
@ -34,19 +34,32 @@ my_shard=$(egrep -o "shard\/[0-9]+" ./latest/validator*.log | tail -n 1)
# Which IP # Which IP
ip=$(curl http://169.254.169.254/latest/meta-data/public-ipv4) ip=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
bingos=$(grep -c "BINGO" ./latest/*log)
# balances=$(./wallet.sh balances)
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"])')
#sudo /sbin/ldconfig -v
#nodeVersion=$(LD_LIBRARY_PATH=$(pwd) ./harmony -version)
#check if you're in snych #check if you're in snych
#Reward #Reward
./wallet.sh balances
echo "Your Sync Status: "$heightStatus #echo "Your Node Version : "
echo "Your Shard: " $my_shard LD_LIBRARY_PATH=$(pwd) ./harmony -version
echo "Your IP: "$ip echo "Your System Status : "$status
echo "You Reward: " echo "Your Sync Status : "$heightStatus
echo "Your Shard : " $my_shard
echo "Your IP: " $ip
echo "Blocks Received : " $bingos
echo "Your Rewards: "
./wallet.sh balances ./wallet.sh balances
# display the first block you started receiving # display the first block you started receiving
# show the percentage of earned / recieved # show the percentage of earned / recieved

Loading…
Cancel
Save