Title: [ANN] bcmon: Monitor your Blades/Cubes/Avalons/AntMinerS1 all at once (linux) Post by: twib2 on January 17, 2014, 04:56:33 AM New Version: 26 Jan 2014
Linux/unix shell-based miner monitoring for blades, cubes, antminers, avalons, and anything that works within cgminer/bfgminer. Added temperature display support for avalons, antminer S1s, chilis - others might work too but I don't have the gear to test them. I have several cubes, and I usually run the stratum_proxy.py from slush so it's hard to monitor them in one place. So, I wrote a few scripts to do the work for me, bcread (to read blades and cubes), minread (to read API output from Avalons and AntMiner S1s, as well as miners like cgminer/bfgminer), and bcshow (to show all that data). I invoke with Code: watch -n 10 bcshow Code: alias bcmon='watch -n 10 bcshow' It occurred to me that I probably wasn't the only one in this situation, so I thought I'd share. The code is not pretty, but it should work fine under most versions of linux. The comments indicate where most of the configuration should be done, but feel free to modify to your liking. Copy these files to your ~/bin directory and chmod +x them and you should be good to go after setting a couple of variables. There are also api-reads to monitor any other miners you have that are set up with api-listen, api-allow, and api-port so they can be monitored. It requires the api-example.py script from bfgminer (or similar). Enjoy - hope this is useful to someone! Tips are welcome but not at all required (BTC: 1GY9wmMmw1E7DPLzQXt4UPuEuHQN29PixD). Here's a window shot of it in action (nothing fancy but most of the monitoring info is there): http://www.kungfu.cc/avs/bcmon.png bcread: Code: #!/bin/bash bcshow: Code: #!/bin/bash minread: Code: #!/bin/bash You also need api-example.py from the bfgminer distro (it's not mine to distribute, so I won't do that without permission). Under the hood: Basically it just scrapes the web interfaces of the blades and cubes and picks out the info I wanted to monitor, then parses it, displays it and does a total hashrate. Then it does API calls and scrapes and formats that data. Simple and probably not nearly as elegant as it should be, but I'm a quick and dirty "basher" when I can get away with it. ;) No doubt these scripts could be easily modified to scrape other miners with web interfaces that don't have APIs, but since I don't have those other miners (and no doubt no-one will donate to me), that is an exercise left to the reader. ;) Title: Re: bcmon: Monitor your ASICMiner Blades and Cubes all at once (linux) Post by: twib2 on January 17, 2014, 04:57:02 AM Reserved
Title: Re: [ANN] bcmon: Monitor your ASICMiner Blades and Cubes all at once (linux) Post by: twib2 on January 22, 2014, 03:29:19 AM 21 Jan 2014: Tightened up the layout and added temperature support (only tested for Chilis and Avalons, but might work with others).
Title: Re: [ANN] bcmon: Monitor your ASICMiner Blades and Cubes all at once (linux) Post by: twib2 on January 26, 2014, 08:39:22 PM 26 Jan 2014: Tightened up the code and made it more robust in case of API info out of order (or reporting GH/s versus MH/s).
Also added temperature support for AntMiner S1 units. Title: Re: [ANN] bcmon: Monitor your Blades/Cubes/Avalons/AntMinerS1 all at once (linux) Post by: 7queue on February 12, 2014, 06:18:33 AM Cool, I'll give this a try!
8 ) Title: Re: [ANN] bcmon: Monitor your Blades/Cubes/Avalons/AntMinerS1 all at once (linux) Post by: mrbi on February 19, 2014, 01:50:38 PM Traceback (most recent call last):
File "./api-example.py", line 53, in <module> response = linesplit(s) File "./api-example.py", line 21, in linesplit buffer = socket.recv(4096) socket.error: [Errno 104] Connection reset by peer I have problem with connections to antminers S1 what is the errno 104 ? I tested using: ./api-example.py stats 192.168.3.34 4028 Title: Re: [ANN] bcmon: Monitor your Blades/Cubes/Avalons/AntMinerS1 all at once (linux) Post by: mrbi on February 19, 2014, 03:05:39 PM I replaced file api-example.py (from distro https://raw.github.com/luke-jr/bfgminer/bfgminer/api-example.py ) and is ok
I have another problem: ~/bin# ./minread ant4 192.168.3.34 4028 (standard_in) 1: syntax error ant4 : 0,000 0,00% 0/m | 0 0 0:00:00:00 How solve this problem? Title: Re: [ANN] bcmon: Monitor your Blades/Cubes/Avalons/AntMinerS1 all at once (linux) Post by: mrbi on February 19, 2014, 05:05:27 PM Solved problem:
on each antminer we must edit: Code: vim /etc/config/cgminer find: Code: option api_allow 'W:127.0.0.1' replace: Code: option api_allow 'W:127.0.0.1,W:192.168.x.x' where 192.168.x.x is your server on which you want check bcmon additional for non english languages linux add new line in top of file: minread Quote LC_NUMERIC=C LC_COLLATE=C |