You can also use ssh to grep the files..
hashrate.sh :
#!/bin/bash
for n in `cat splist`; do
echo "$n - `sshpass -p root ssh root@$n -oStrictHostKeyChecking=no cat /tmp/asics | grep HW:`" &
done
usage
$ ./hashrate | sort
sp20a - [H:HW:1180Gh,W:501,L:0,A:8,MMtmp:0 TMP:(24)=>=>=>(52,47)]
sp20b - [H:HW:1209Gh,W:512,L:0,A:8,MMtmp:0 TMP:(25)=>=>=>(53,48)]
sp20c - [H:HW:1228Gh,W:515,L:0,A:8,MMtmp:0 TMP:(22)=>=>=>(50,46)]
sp20d - [H:HW:1220Gh,W:514,L:0,A:8,MMtmp:0 TMP:(23)=>=>=>(51,47)]
sp20e - [H:HW:1182Gh,W:513,L:0,A:8,MMtmp:0 TMP:(21)=>=>=>(48,46)]
sp20f - [H:HW:1505Gh,W:747,L:0,A:8,MMtmp:0 TMP:(16)=>=>=>(61,54)]
sp20g - [H:HW:1222Gh,W:516,L:0,A:8,MMtmp:0 TMP:(18)=>=>=>(51,51)]
sp20h - [H:HW:1249Gh,W:542,L:0,A:8,MMtmp:0 TMP:(19)=>=>=>(51,46)]
sp20i - [H:HW:1212Gh,W:516,L:0,A:8,MMtmp:0 TMP:(29)=>=>=>(54,56)]
sp20j - [H:HW:1251Gh,W:533,L:0,A:8,MMtmp:0 TMP:(29)=>=>=>(60,58)]
or:
$ ./hashrate.sh | egrep -oh [0-9]+Gh | sort
1180Gh
1182Gh
1209Gh
1212Gh
1220Gh
1222Gh
1227Gh
1249Gh
1251Gh
1504Gh
power.sh
#!/bin/bash
for n in `cat sp20.list`; do
echo -e "$n\n`sshpass -p root ssh root@$n -oStrictHostKeyChecking=no cat /tmp/asics | grep PSU`" &
done
you can grep and awk to add them all up too:
total.sh
#!/bin/bash
echo -n "power: "
./power | egrep '([0-9]w)' | cut -d' ' -f3 | awk '{s+=$1} END {print d, s}' "d=$(date +"%m-%d-%Y-%T")"
echo -n "hashrate: "
./hashrate | egrep -oh [0-9]+Gh | egrep -oh [0-9]+ | awk '{s+=$1} END {print d, s}' "d=$(date +"%m-%d-%Y-%T")"
usage: (this is NOT the actual power at the wall )
$ ./total
power: 01-19-2015-16:37:48 6737
hashrate: 01-19-2015-16:37:49 12458