Coder Social home page Coder Social logo

mpc-monitor's Introduction

validator-monitor

A tool to monitor Wanchain validator running status, including:

  • CPU Usage
  • Memory Usage
  • Disk Usage
  • Block Delay
  • Coinbase Balance
  • Prerequisites

    Install Node.js and npm.

    Download

    Download source code from github

    git clone https://github.com/wanchain/validator-monitor.git
    cd validator-monitor

    Install Dependencies

    Execute the command in the validator-monitor directory:

    npm install

    Configuration

    The configure file is named config.js, it contains several goups and items:

  • email group
  • item description
    smtpServer required
    smtpPort required
    secure required
    authUser required
    authPassword required
    receiver required

    All of above items are required, and should be set according to your email service provider. Please make sure that SMTP is enabled and authentication is correct.

  • gwan group
  • item description
    ipcPath required

    The monitor communicates with gwan via IPC, so ipcPath should be set according to the gwan startup parameters. The default path is /home/user/.wanchain/gwan.ipc. Please use the absolute path.

  • monitor group
  • item description
    diskName default is the root directory ("/"), could be changed if gwan uses another disk or partition
    reportName optional, used to identify different validators if you have more than one
    reportHour default is 10 o'clock, when to send daily report, based on the monitor server clock

  • threshold group
  • item description
    cpuUsage default is 80, in percentage
    memoryUsage default is 80, in percentage
    diskUsage default is 80, in percentage
    peers default is 20

    How to Test

    Execute the command in the validator-monitor directory:

    npm run test

    It will check the email configuration. If correct, the receiver should receive an email with subject "Wanchain Validator Monitor".

    Start Monitor

    The validator-monitor is scheduled by crontab, you need to create a task:

    crontab -e

    Insert one line at the end of the opened file and save:

    */10 * * * * ~/validator-monitor/start.sh > ~/validator-monitor/validator-monitor.log 2>&1

    You can check the task with:

    crontab -l

    NOTE: please replace "~/validator-monitor" with your own validator-monitor path.

    Report

    Reports will be sent by email.

    If there is any alert, an email will be sent immediately, with subject:
    ALERT - MPC Node Monitor

    Otherwise, a report email will be sent daily, with subject:
    NORMAL - MPC Node Monitor

    FAQ

    IPC connect failed

    Make sure the gwan.ipc could be accessed with read and write permissions. Run the command:

    sudo chmod 766 gwan.ipc

    mpc-monitor's People

    Contributors

    gabriel-2010 avatar zhwir avatar

    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.