Code Monkey home page Code Monkey logo

ot-nodewatch's Introduction

OT-NodeWatch

IMPORTANT : This repository does not support docker nodes

You must follow the instructions on OT-Settings repository before proceeding here

A collection of scripts to monitor your OriginTrail Nodes

All monitor scripts will notify you through Telegram anytime an issue arises.

For instance, if bid_check.sh doesn't see your node bid on a job within 1 hour, it will send you a Telegram message.

This collection includes:

bid_check:

  • Checks the logs for "Accepting" which indicates a bid. Checks every hour by default (changeable).
  • Checks the logs for "ve been chosen" which indicates an awarded job. Checks every hour by default (changeable).

disk_check:

  • Checks the disk space used every day by default (changeable).

Manual installation:

Log into server as root.

apt install jq
cd
git clone https://github.com/calr0x/OT-NodeWatch.git

bid_check:

Default check is every hour.

crontab -e

Press '1' (if asked) to select nano as the editor.

0 * * * * /root/OT-NodeWatch/bid_check.sh
ctrl+s 
ctrl+x

disk_check:

Default check is once a day.

crontab -e

Press '1' (if asked) to select nano as the editor.

0 0 * * * /root/OT-NodeWatch/disk_check/disk_check.sh
ctrl+s
ctrl+x


Read the commented info inside each script for more details

nano /root/OT-NodeWatch/bid_check.sh
nano /root/OT-NodeWatch/disk_check.sh

when done,

ctrl+x

ot-nodewatch's People

Contributors

calr0x avatar valcyclovir avatar

Watchers

 avatar  avatar  avatar

ot-nodewatch's Issues

Missing notification when node not bidding

bid_check-dockerless.sh is missing a notification to TG when node is not bidding

Solution :
add follow line back to script :

if [ $BIDS -eq 0 ]; then
/root/OT-NodeWatch/data/send.sh "Has not bid in the last $BID_INTERVAL"
fi

Monitor available collateral tokens

Do a daily check for available tokens to be used for collateral. We don't want to run out of collateral tokens and not build accept any more jobs.

bid_check.sh improvements

bid_check.sh currently verifies that our nodes accept jobs and notifies us when we get a job

Suggestion :
Improve the "job rewarded" feature by adding the amount of trac won and holding time.

install-disk-check.yml overwritting config.sh

Running ansible-playbook install-disk-check.yml overwrites config.sh settings

Solution :
add the following on line 27 :
- name: Install config.sh
copy:
src: ~/OT-NodeWatch/config.sh
dest: /root/OT-NodeWatch/config.sh
owner: root
group: root
mode: '0600'

bid_check false alarm when logs not showing accepting

Situation :
Jobs sometimes do not show Accepting offer with price: xxxx TRAC, and therefore is not detected by the script used by bid_check.sh
the word chosen seems to give more accurate results

Temporary solution :
change line to
docker logs --since $BID_INTERVAL otnode | grep chosen | wc -l

disk space check

Hi. My name is K'walla and I want to know when my disk space is > 90% or so. I also want a new bike and hot wheels and a baby brother. thank you santa.

Add job detection

Check if jobs are being issued before acting in no bids detected.

TG notification very spammy

Situation :
TG notification for no job detection every 15 minutes is working as intended, but the notification spam when jobs are scarce is annoying and hard to filter through.

Suggestion :
Instead of showing individual notifications from each node, have the notifications grouped up in a way that's easier to read and not as spammy, such as :
(X+Y+Z)/total nodes (X, Y, Z) have not had a job detected in the past 15 minutes.

Notification of a new job

Hi, would it be possible to add a notification for a new offer being accepted? Thanks for your work mate!

Disk check.sh refers to disk_space.sh

  • name: Install disk_space.sh
    copy:
    src: ~/OT-NodeWatch/disk_check/disk_check.sh
    dest: /root/OT-NodeWatch/disk_check/disk_check.sh
    owner: root
    group: root
    mode: '0700'

Need to update to:

  • name: Install disk_check.sh
    copy:
    src: ~/OT-NodeWatch/disk_check/disk_check.sh
    dest: /root/OT-NodeWatch/disk_check/disk_check.sh
    owner: root
    group: root
    mode: '0700'

Bid check Missing ansible instructions

Need to run:
ansible-playbook install-bid-check.yml

When finished updating configs to apply changes to all nodes from ansible.

Other instructions also missing for ansible like editing install-bid-check.yml:
nano install-bid-check.yml

and lastly editing bid_check.sh:
nano bid_check.sh

Suggestion : add pruned data amount on TG report

Current TG notification :
OTNODE: Forget command SUCCEEDED
OTNODE: Prune command SUCCEEDED
OTNODE: Check command SUCCEEDED

Suggestion :
Add a more detailed infographic to include amount of data pruned and how many nodes have been pruned to make sure it actually succeeded

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.