Bitcoin Forum
September 24, 2017, 09:26:49 PM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »  All
  Print  
Author Topic: cgmon - mining monitor for Linux - auto restart, reboot, sick gpu, ASIC, &more  (Read 46998 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
November 30, 2013, 07:21:33 PM
 #1

Tired of finding miners sick, dead, or crashed for long periods of time?  I was!  Here's cgmon, a lightweight, free, and open source script which performs these functions in Linux:

  • Monitors health of all GPU's & ASIC's.  If a GPU crash or problem is detected, reboots the computer and starts mining automatically.
  • Auto restart cgminer when it crashes.
  • Auto restart of computer if cgminer becomes unresponsive.
  • Monitors Accepted Share counts per GPU/ASIC - restart & notify if a GPU/ASIC is not outputting accepted shares.
  • Monitors network connection and mining pools for outages.
  • Email notification of all actions.
  • Now has SMTP AUTH support for gmail and other ISPs*
  • Automated version checking and upgrading
  • Runs via command line in 'screen' so you can access cgminer at anytime.
  • Runs cgminer in the background
  • Can be started/viewed via SSH
  • Supports unlimited GPU's/ASIC's.
  • Supports up to five mining pools.
  • Supports sgminer 4.0.0

Requires: PHP, TCL, and screen.

Compatible with:
cgminer 3.1.1 -> 3.7.2
sgminer 4.0.0
vertminer

Tested in Ubuntu, CentOS, and BAMT.  Should work in all other unix-based operating systems.

I'm sure there are bugs.  Report them in this thread.

Latest version released on 2/16/2014: cgmon 1.0.5
Download: http://www.forked.net/~apex/cgmon/cgmon.tcl

Installation Instructions
Code:

1) Install PHP, TCL and screen.  
 CentOS: yum install php53 tcl screen
 Ubuntu: apt-get install php5 php5-cli tcl screen

 2) Edit the following line with your path to cgmon.tcl and then add it to /etc/crontab. *must run as root for DEAD/SICK GPU/ASIC rebooting.
    */2 * * * * root /home/user/cgmon.tcl >/dev/null 2>&1

 3) chmod +x cgmon.tcl

 4) Fill out the configuration sections in cgmon.tcl and test the script by running it directly: ./cgmon.tcl

 5) Sit back and enjoy a steadier flow of income :)
 

*SMTP AUTH require tcllib and tcl-tls.  See inscruction in cgmon.tcl auth settings.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
1506288409
Hero Member
*
Offline Offline

Posts: 1506288409

View Profile Personal Message (Offline)

Ignore
1506288409
Reply with quote  #2

1506288409
Report to moderator
1506288409
Hero Member
*
Offline Offline

Posts: 1506288409

View Profile Personal Message (Offline)

Ignore
1506288409
Reply with quote  #2

1506288409
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1506288409
Hero Member
*
Offline Offline

Posts: 1506288409

View Profile Personal Message (Offline)

Ignore
1506288409
Reply with quote  #2

1506288409
Report to moderator
1506288409
Hero Member
*
Offline Offline

Posts: 1506288409

View Profile Personal Message (Offline)

Ignore
1506288409
Reply with quote  #2

1506288409
Report to moderator
1506288409
Hero Member
*
Offline Offline

Posts: 1506288409

View Profile Personal Message (Offline)

Ignore
1506288409
Reply with quote  #2

1506288409
Report to moderator
pciccone
Newbie
*
Offline Offline

Activity: 10


View Profile
December 11, 2013, 04:00:39 PM
 #2

This really is a great script! Grin Just 2 small problems I found in it:

- HELO command is missing on the socket send in the sendmail function. This is required by most SMTP servers to accept mail. It should be the first thing sent. i.e.
        puts $sockid "HELO $hostname"

- My cgminer (at least 3.7.2 very popular version for scrypt mining) has the PHP API as 'api-example.php' in the directory. Threw me off for a minute, was not sure which was required till I dug in and figured it out.

Phil
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
December 13, 2013, 05:37:56 AM
 #3

Wow, glad you like it. Smiley  

Were your emails not being sent before you added that line?  Mine haven't had that issue.   Perhaps my mail server just isn't that picky  (sendmail)?

I've made a *bunch* of improvements and fixed more bugs, so I'll need to upload a new version soon....

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
December 13, 2013, 06:30:18 AM
 #4


New version in the works:

*) Shell script built-in.
*) cgminer API built-in.  No need to mess with that file at all anymore.
*) Checks for miners that are not outputting Accepted shares (i.e. cgminer is running, but not outputting good shares).
*) Timestamps in emails and logfile
*) Improved error reporting
*) Simplified configuration

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
elproducto
Newbie
*
Offline Offline

Activity: 9


View Profile
December 30, 2013, 06:22:19 AM
 #5

Great program.  I was just not sure if it was running or not. It was not.  I issued ./cgmon.tcl after entering all the parameters in the cgmon.tcl file.  Some parameter where wrong and was able to repair with the information outputted from the script.  I needed to install PHP5 guess I missed the dependencies on the first post.  I had a some suggestions since your are working on a new version would the script be able to restart the computer in case it is unable to restart cgminer, also would it be possible to monitor temperature and throttle intensity based on if a GPU reaches a certain temperature.
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
December 30, 2013, 05:07:05 PM
 #6

The current version will restart the computer if any GPU crashes.  This feature only works if you are running the script as root.   

Alternatively, it should be possible to setuid root the 'shutdown' command  to avoid running the script as root.  I haven't tried this.

If a GPU hits or exceeds cgminers '--temp-overheat' setting, the computer will be restarted.  This is 85 degrees by default.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
December 31, 2013, 02:39:22 AM
 #7

New version is out. Smiley

Changes since last release
  • Built cgminer api into script (easier setup).
  • Timestamps in logfile and email notifications.
  • HELO mail fix.
  • Simplified configuration.
  • Added broadcast message before rebooting server.
  • Moved cgmon-mine.sh to /tmp/ so the script can run as the cgminer user.
  • Moved cgminer api to /tmp/.
  • Secondary mining pool is now optional.

TODO:
  • check for Accepted shares
  • notify on GPU overheat

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
elproducto
Newbie
*
Offline Offline

Activity: 9


View Profile
January 05, 2014, 06:55:18 AM
 #8

The current version will restart the computer if any GPU crashes.  This feature only works if you are running the script as root.   

Alternatively, it should be possible to setuid root the 'shutdown' command  to avoid running the script as root.  I haven't tried this.

If a GPU hits or exceeds cgminers '--temp-overheat' setting, the computer will be restarted.  This is 85 degrees by default.

Thanks for the update.  I have updated my miner to the latest version I will let you know if i find any issue, i doubt I will.  I have yet to receive and emails from the program but have found a miner not responding, but I am still investigating the cause.
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
January 05, 2014, 07:22:38 PM
 #9

Check the log file called 'cgmon.log'.  It is updated each time the script runs with the current status of cgminer.  You'll be able to see if it's working, or if there's a problem.

Currently there's no error checking of email notifications.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
tfbpa
Jr. Member
*
Offline Offline

Activity: 47


View Profile
January 16, 2014, 04:58:59 PM
 #10

Thanks very much for the script. I had to change and add a few settings, but all is working great now. Finally, I can sleep...
polde
Jr. Member
*
Offline Offline

Activity: 51


View Profile
January 19, 2014, 03:16:01 AM
 #11

Thx for that script its relay nice. Just need to test email notification.

Can I use gmail.smtp.com for sending email or i must setup my one smtp?

otherwise script is working nice with small modification; path to cgminer was missing.

Thx again
chrisbraddock
Newbie
*
Offline Offline

Activity: 2


View Profile
January 21, 2014, 09:35:52 PM
 #12

Hey jdape - thanks for this. Being a dev myself I started wanting to tinker with it right away. But, I don't know TCL. Smiley

Long story short I ended up re-implementing cgmon in JavaScript with node.js. I think it's pretty close now: node-cgmon.

Not sure if you know JavaScript but if you ever want to consolidate efforts, let me know.

FYI, I cited cgmon in the credits.
suzukii
Full Member
***
Offline Offline

Activity: 161


View Profile
January 22, 2014, 04:52:16 AM
 #13

Wow this sounds just like what the Mining doctor ordered.   Grin

The problem is I'm a Linux virgin. 
My only experience with it is buying the Raspberry Pi Model B with Minepeon version 2.4.3 three weeks ago.

I got the Minepeon image loaded up on it & it has been countless manual reboots ever since whenever 1, 2 or 4 of my 9 erupters go on vacation while my viewing them from a windows browser.

Anyone have idiot proof instructions on how to get this added to my system?

Keep in mind that the only thing Linux I know to do is to load the Putty Windows app to SSH in from my Windows PC & ad the MobileMiner app.

Basically I am asking for hand holding.  It's probably easy for most on here, but not for this old rooky trying to do a little mining in between newborn baby boy feedings & diaper changes.  The wife takes over at night.


Thanks in advance for any help.

Regards,

Suzukii

(Live long & ...keep mining)

Hardware:
Avalon 200Gh/s 55nm | Raspberry Pi model B | Minepeon 0.2.4.3 (...was 0.2.5-pr2) | BFGMiner 3.10.0 | 28x Manhattan USB 2.0/3.0 powered Hub | 5x ASIC Block Erupter @333 MH/s | 3x BFL Jalapeño's Total ~232.7 GH/s
Reg1x
Newbie
*
Offline Offline

Activity: 1


View Profile
January 26, 2014, 07:00:08 PM
 #14

This scrip is installed on LTC bamt i think? or not?
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
January 26, 2014, 08:04:49 PM
 #15

This scrip is installed on LTC bamt i think? or not?

It will run in BAMT.  You would need to install TCL and screen if they're not already included.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
January 26, 2014, 08:31:41 PM
 #16

Can I use gmail.smtp.com for sending email or i must setup my one smtp?

Gmail SMTP requires authentication, which is not supported in cgmon.tcl.  You could try using your local ISPs smtp server.


Quote
otherwise script is working nice with small modification; path to cgminer was missing.

Thanks.  I've added a test in the latest version that addresses this issue.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
January 26, 2014, 08:55:56 PM
 #17

Uploaded new version:

cgmon 0.1b5
  •    Fixed .sh ownership problem
  •   Added test for cgminer/cgminer path
  •   Split cgminer_cmd into cgminer_path and cgminer_extra_options for ease of use

Download: http://www.forked.net/~apex/cgmon/cgmon.tcl

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape
Sr. Member
****
Offline Offline

Activity: 269


View Profile WWW
January 26, 2014, 09:01:40 PM
 #18

Hey jdape - thanks for this. Being a dev myself I started wanting to tinker with it right away. But, I don't know TCL. Smiley

Long story short I ended up re-implementing cgmon in JavaScript with node.js. I think it's pretty close now: node-cgmon.

Not sure if you know JavaScript but if you ever want to consolidate efforts, let me know.

FYI, I cited cgmon in the credits.


Awesome work!  Looks like you added a lot of  features and options too.

Unfortunately, I don't know any JS. :/

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
sbmager
Newbie
*
Offline Offline

Activity: 1


View Profile
January 27, 2014, 10:22:47 PM
 #19

Jdape, great script!  Thanks.

Question - is there any way to configure smtp authentication in the cgmon.tcl script? Gmail and my ISP (verizon) require authentication (ports 465 or 587).  

Thanks  
MrBobC
Member
**
Offline Offline

Activity: 110


View Profile
January 27, 2014, 11:23:31 PM
 #20

By any chance would this also support sgminer if I just change the directories and exe files it points to to sgminer?  Looking to use this with BAMT 1.3.  Thanks!
Pages: [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!