Author

Topic: [Solved] Where is the current Hash Rate stored on Antminer S1's? (Linux FS?) (Read 2280 times)

full member
Activity: 150
Merit: 100
Great!! Thank you!
member
Activity: 68
Merit: 10
Just thought i might add a bit. This is how i pull hashrate out of my miner. Mind you it's on a stadard ubuntu box...

/opt/bfgminer/api-example.py | awk '/MHS av/ {print "Hashrate.value " substr($3, length($3) -8, 7)}'


I have that line incorporated into a munin plugin, but there's no reason you can't incorporate it into a shell script and cron it...
full member
Activity: 150
Merit: 100
Excellent information mitty! I should be able to use that API to access the information. In fact, I bet there are some good code samples laying around the Internet for using that API.

Much appreciated!
sr. member
Activity: 359
Merit: 250
The web UI is getting all the mining stats from the cgminer API, not from anywhere on the filesystem.  It connects to the cgminer API via a TCP socket (I think), requests the info, then displays it on the webpage.
You can use something like ncat to grab the info and write a script to grab the info and then use wget or curl to send it to the web service.

More info on the cgminer API: https://github.com/ckolivas/cgminer/blob/master/API-README

Edit: I'm not sure if the OpenWRT firmware on the AntMiner has netcat and/or ncat, but you can give it a try
full member
Activity: 150
Merit: 100
I'd like to create a cron job on my S1's that fire off the current hash rate very so often to a web service which can then determine whether an email or text alert needs to go out.

Does anybody know where, or if, current hash rate data is stored?

The Web GUI is getting it from somewhere! I suppose I could analyze the web GUI code and sort it out, but figured I should ask here first.

Thanks!
Jump to: