GithubHelp home page GithubHelp logo

jmordica / cgmonitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chrisbraddock/node-cgmon

0.0 3.0 0.0 179 KB

a utility intended to monitor and maximize uptime of cgminer under linux

JavaScript 97.17% Shell 2.83%

cgmonitor's Introduction

node-cgmon

node-cgmon is a utility intended to monitor cgminer or sgminer under linux and maximize its uptime

(developed and tested mainly against cgminer 3.7.2 performing scrypt-based mining)

What it Does

node-cgmon starts a cgminer or sgminer screen instance then monitors mining status via process inspection and the cgminer/sgminer APIs. node-cgmon looks for different indicators of miner failure such as high GPU temp, high fan speed, API disconnect and attempts recovery and/or reboot in order to continue mining.

node-cgmon can also log output to help diagnose mining failures and will also send email notifications so you can take action if mining stops.

Prerequisites

  • OSX or linux host operating system (node-cgmon has been tested only on OSX 10.9 and Xubuntu linux 13.10)
  • node
  • npm
  • screen

Usage

  1. copy config/config.sample.json to config/config.json

  2. override any config values needed in config/config.json (see the CONFIG section in cgmon.js for values you can use here)

    example config/config.json:

    {
        "minerName": "my miner",
        "email": {
            "user": "[email protected]",
            "pass": "your gmail password",
            "from": "from email address",
            "to": "to email address"
        }
    }
    
  3. copy start_miner_example.sh to start_miner.sh

  4. edit start_miner.sh for your environment; modify the paths to cgminer and you cgminer configuration file; NOTE: make sure to leave '--api-listen' on the cgminer command

  5. run npm install (from node-cgmon directory) to install node-cgmon dependencies

  6. run cgmon-node (from node-cgmon directory): node cgmon.js

  7. screen -r cgminer should attach to your cgminer screen instance and show you standard cgminer output (CTRL+A CTRL+D) to detatch

NOTE: if you run this node process under a non-superuser, you must give node permissions to reboot the system:

sudo setcap CAP_SYS_BOOT=+ep /path/to/node/binary

TODO

  • restart cgminer if hasrate falls below a threshold (currently only warns via email)
  • restart cgminer if total shares stop increasing based on a threshold
  • switch to basic smtp vs. Gmail-only
  • break up monitor() method
  • check that scripts are executable
  • fix janky arguments passing in api() method
  • figure out jQuery deferreds mess
  • decide what should be done if gpu count is wrong
  • email for coin changes (not sure how to do this via information reported from coin()
  • periodic restart/reboot?

Credits

node-cgmon was inspired by cgmon.tcl and borrows concepts from CGWatcher.

node-cgmon leverages a few Node modules but most notably, node-cgminer which eliminated a nice bit of work.

License

The content of this project itself is licensed under the Creative Commons Attribution 3.0 license, and the underlying source code used to format and display that content is licensed under the MIT license.


If you find this software useful, donations are welcome at:

BTC 1JqsUozh2EZVWqA4RxdnsUSNvmEwpFAhWP

LTC LLoCXwYRBQGL44vGZWRYrsScweYJzkcvqh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.