Bitcoin Forum
May 26, 2024, 05:01:30 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [SCRIPT]Mass miners control for BAMT/SMOS Linux  (Read 2464 times)
Demontager (OP)
Newbie
*
Offline Offline

Activity: 60
Merit: 0


View Profile
March 09, 2014, 07:45:51 PM
Last edit: April 13, 2014, 06:52:03 PM by Demontager
 #1

I want to share my bash script for controlling mining servers running on BAMT 1.3/1.5/1.6 or SMOS Linux (optionally PIMP). It may control any number of mining servers. It is preferably to run it against BAMT 1.6 servers as script already included easy function to quickly switch over mining software e.g. cgminer/sgminer/vertminer. Also it is possible to add your own custom compiled miner and switch to it within menu. Tested on Lubuntu 13.10 and on any Debian based distros should work out of box, also it may run on any Linux distro with small modifications.

Big thanks to RLutz
i used part of his code for cron section https://bitcointalk.org/index.php?topic=490840.msg5409109#msg5409109

List of features:

-Power of secured SSH connection (use only SSH)

-Fully interactive menu

-Email notification when mining failed

-Unlimited number of mining servers

-Automatically adds non-password authentication

-Custom colors for menus and messages

-Reboot selected miner or all together

-View/Edit pool config for selected miner

-Switch over between 4 included mining software in BAMT 1.6 + 2 custom

-Real-time monitoring for all servers in one window

-Cron task to periodically control and reboot dead/sick/idle mining servers

Initial setup

1. Download script to any folder

2. Make script executable chmod +x mine.sh

3. Edit mining servers IP in script body. Also configure pools

4. Launch script ./mine.sh

5. Set up non-password authentication. Press 6 (Configure mining server SSH authentication)and proceed to further instructions.

6. All done. You may back to menu and choose desired option.

(Optional)
7. If you would like to setup cron job then you need to run script with cron parameter. For example to test mining servers every 20 minutes add line to crontab. */20 * * * * /root/mine.sh cron
8. Enable email notifications, set notify="YES" and enter email details. Then while running cron task script will perform checks and if mining failed you will get email. Also at any time you may send mining logs from all miners to defined email, this option available within main menu.

How to add your custom miner. As an example explained how to add YACminer.

1.    Copy or compile yacminer in /opt/miners
2.    Change directory to /opt/miners/YACminer and rename yacminer binary to cgminer. Make sure it has executable flag "x" if not do chmod +x cgminer
3.    Rename /opt/miners/YACminer to /opt/miners/custom
4.    Create yacminer configuration file /etc/bamt/custom.conf (Pools and miner settings)
5.    Run bamt.sh and choose "Change mining software.." from the menu then in next submenu choose "custom"
6.    That's it. Yacminer now default mining software. Mining process will restart automatically.

Note: In same way you may add custom1 miner, but make sure to keep these names /opt/miners/custom1 and /etc/bamt/custom1.conf


Please let me know if you found any bugs or want to suggest something.


Screenshots

Main menu
https://i.imgur.com/kE0Gzkp.png

Mining servers' status
https://i.imgur.com/xkhothU.png

Switch over between mining software
https://i.imgur.com/HcdkT01.png

Real-time monitoring
https://i.imgur.com/hN2Ib91.png

Email notifications
https://i.imgur.com/YlruR6y.jpg

Updates:
13.04.2014-Added edit config and restart mining option
11.04.2014 -Added email notifications
08.04.2014 -Separated bamt/pimp scripts
03.04.2014 -Added PIMP support (see PIMP folder)
28.03.2014 -Added card status direct check via cgminer API
25.03.2014 -Added quick ssh login item to menu

You may give me some bounty to support my work and further improvement:

BTC: 1PGgybf5QbCTohCoRgEA4Q5ZSLhpSsg8cn

LTC: Lbw6bd3T3XaMypF1XsuryH3J9zMoY7gLTv


Download: https://github.com/Demontager/minessh/archive/master.zip

Github All further updates will be committed there:  git clone https://github.com/Demontager/minessh




Demontager (OP)
Newbie
*
Offline Offline

Activity: 60
Merit: 0


View Profile
March 10, 2014, 05:40:29 PM
Last edit: March 23, 2014, 06:37:00 PM by Demontager
 #2

Reserved
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!