Code Monkey home page Code Monkey logo

serverbot's Introduction

ServerBot Readme

This is telegram bot for server monitoring. This bot can send messages to your telegram id Tested on ubuntu 18.04 & python 3.6.9

What this bot can do?

Monitoring

  1. CPU load
  2. RAM load
  3. Network

Historical data

  1. CPU Utilization
  2. RAM Load
  3. Disk I/O
  4. Network perfomance
  5. Ping test

Alert

  1. High CPU Utilization
  2. High RAM load
  3. Network degradation

Server

  1. Check CPU load
  2. Check RAM load
  3. Check disk usage
  4. Check disk i/o
  5. Check server ping
  6. Alalyze server traceroute
  7. Get top processes
  8. Check uptime
  9. Check network load
  10. Make a speedtest

Near validator tools and alerts

  1. Alert if node is down
  2. Alert if node is out of sync
  3. Alert if node produce less blocks than expected
  4. Validator info:
    • Pool name
    • Pubkey
    • Stake
    • Blocks produced and expected
  5. Node logs

Installation

  1. Create telegram bot and get Api Token with @BotFather.
  2. Send to your new bot command /start
  3. Clone bot to server
cd $HOME && git clone -v https://github.com/ama31337/serverbot.git && cd ./serverbot && chmod +x ./installsbot.sh
  1. Open ./config.py and insert your bot API and your telegram id.
  2. Run script ./installsbot.sh for Ubuntu/Debian and ./installsbot_centos.sh for CentOS, source your bash or zsh to make bot start/stop commands working
./installsbot.sh
source ${HOME}/.bash_aliases
source ${HOME}/.zshrc

Update

  1. Backup your old config and pull changes from git
cd $HOME/serverbot && mv config.py config.py.bak && git pull
  1. Compare the configs and adjust if necessary
  2. Restart bot
botstop
botstart

Start, stop or check bot status

If you make any changes in config you need to restart your bot. To start, stop or check status you can use commands in bash:

botstart
botstop
botstatus

What to do if something not working?

If you get History load error, remove bot files from /tmp and from serverbot db dirs

sudo rm -rf /tmp/*.log
sudo rm -rf /tmp/*.png
sudo rm ${HOME}/serverbot/db/*

Find in bot.py telebot.logger.setLevel(logging.ERROR) and change ERROR to DEBUG, restart serverbot service and execute

$ sudo journalctl -e -u serverbot > ~/serverbot/servicelog.log

If near tools not working, make sure what you've near is /usr/bin, if not:

which near
near_path=$(which near)
sudo ln -s ${near_path} /usr/bin/near

If bot was helpful to you, stake with us --> @lux.poolv1.near

serverbot's People

Contributors

anvme avatar ama31337 avatar boo50 avatar qinidema 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.