Created
January 2, 2019 15:06
-
-
Save bitkevin/020da1b66eb616accece8bf0d669f109 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IP=$1 | |
STATS_JSON=`echo -n '{"command":"summary"}' | nc "$1" 4028 |json_pp` | |
GHS_5s=`echo "$STATS_JSON" | grep "GHS 5s" |awk -F'"' '{print $4}'` | |
GHS_avg=`echo "$STATS_JSON" | grep "GHS av" |awk -F':' '{print $2}' |awk -F',' '{print $1}' | tr -d '[:space:]'` | |
DATESTR=`date '+%Y-%m-%d %H:%M:%S'` | |
FILE=`date '+%Y-%m-%d'` | |
echo $DATESTR,$GHS_5s,$GHS_avg >> /home/xxx/dev/"$1"-"$FILE".txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment