Hi Isokivi, I'd be happy to give this a go over the weekend (we do a reasonable amount of parsing of text files in bash, so it should be straightforward). However, we don't have any bitfury hardware yet (October can't come round soon enough ), so would need some sample log files and some info on the file locations etc. Let me know if you're interested - somebody else may have done it already of course and may be able to share more quickly.
This is what they look like: http://pastebin.com/xN7t9WaH
Please note that: pastebin screws up the line lenght, all the info regarding a single chip is actually on one line.
And secondly, this is a sample of that has two h-boards, the maximum is sixteen.
Let me know if theres something else I can help with.
[edit] btw since theres propably no nice way to time the data collection exactly when the new logs are generated (or perhaps there is, Im out of familiar waters here) I would suggest that you have the script pick up data every 330 seconds (5min 30 sec).
Hi Isokivi, could you give this a try to see if it's broadly what you're after (at least until a more elegant solution is coded into chainminer)? It's not pretty, but I think that it should work. It's just set up to grab board stats at the moment, but can be modified to grab chip-level stats if required in a later version. There may be bugs when trying to grab data from the real system, so it may need tweaking. I've set the sleep time to 120 seconds, as 330 seconds would miss some data after some time I think (unless I'm miscalculating - It's late ).
# Bitfury chainminer logfile consolidation script
# Jlsminingcorp, September 2013
# Version 1.0
logfile="/run/shm/.stat.log"
output="./boards.log"
datestamp=$(ls --full-time "$logfile" | awk '{print $6}')
timestamp=$(ls --full-time "$logfile" | awk '{print $7}' | awk -F"." '{print $1}')
# If log file or output file don't exist then take appropriate action
if [ ! -e "$logfile" ]; then
echo "$datestamp","$timestamp""Logfile does not exist in the specified location" >> "$output"
exit 1
fi
if [ ! -e "$output" ]; then
echo "Date,Time,Board Position,Speed,Noncerate [GH/s],Hashrate [GH/s],Good,Errors,SPI-Errors,Miso-Errors" > "$output"
fi
# If timestamp in the log file is the same as the timestamp on the last entry in the output file then sleep for a while
prevtimestamp=$(tail -n 1 "$output" | awk -F"," '{print $2}')
while [ "$timestamp" == "$prevtimestamp" ]; do
sleep 120
timestamp=$(ls --full-time "$logfile" | awk '{print $7}' | awk -F"." '{print $1}')
done
# When there's new data in the log file strip this out and copy to the output file
IFS=$'\r\n' datalines=($(grep '.: ' "$logfile"))
count=0
while [ $count -lt ${#datalines[@]} ]; do
data=$(echo "${datalines["$count"]}")
eddata=($(echo $data | tr ":" " "))
data_array=($(echo $eddata | tr " " "\n"))
echo -ne "$datestamp","$timestamp" >> "$output"
for i in "${data_array[@]}"; do
echo -ne ,"$i" >> "$output"
done
echo "" >> "$output"
let count=count+1
done
exit 0