Coder Social home page Coder Social logo

servbot's Introduction

Linux Server Monitoring with Telegram Bot

Requirements

  • Git
  • Nginx
  • PHP-FPM
  • PHP
  • BIND
  • Certbot
  • Telegram

Installation

  • Configure the Web Server and SSL: https://certbot.eff.org/lets-encrypt/centosrhel7-nginx
  • Cloning PHP source code: https://github.com/xnxmx/servbot.git
  • Chat in Telegram with @BotFather (https://t.me/BotFather) and create a new bot
  • Get your API token (example: 613961047:AZFWy0k603kLssujSIkKacmKuxxxTnq8Wl4)
  • In php file line 2, change <authorization_token> with your API token (example: 613961047:AZFWy0k603kLssujSIkKacmKuxxxTnq8Wl4)
  • Upload the index.php file to your Web Server with SSL support
  • Then access the following URL: https://api.telegram.org/bot<authorization_token>/setWebhook?url=https://domain.tld/index.php in the web browser to set the webhook (example: https://api.telegram.org/bot613961047:AZFWy0k603kLssujSIkKacmKuxxxTnq8Wl4/setWebhook?url=https://domain.tld/index.php
  • Chat in Telegram with @BotFather (https://t.me/BotFather) and edit @yourBotName commands:
df - Report file system disk space usage
free - Display amount of free and used memory in the system 
ps - Report a snapshot of the current processes
top - Report a snapshot of the current processes
namedstatus - Show Internet domain name server service status
nginxstatus - Show HTTP and reverse proxy server, mail proxy server service status
phpfpmstatus - Show PHP FastCGI Process Manager service status
sshdstatus - Show OpenSSH SSH service status
date - Print or set the system date and time
uptime - Tell how long the system has been running
id - Print real and effective user and group IDs
ls - List directory contents
pwd - Print name of current/working directory
last - Show a listing of last logged in users
w - Show who is logged on and what they are doing
phpversion - Show PHP version number
sysinfo - Print system operation information
uname - Print system information
nc - Arbitrary TCP and UDP connections and listens
ping - Send ICMP ECHO_REQUEST to network hosts
telnet - User interface to the TELNET protocol
traceroute - Print the route packets trace to network host
curl - Transfer data from or to a server
dig - DNS lookup utility
whois - Client for the whois directory service
  • Enjoy!

Notes

  • SERVBot is still tried on CentOS 7 x86_64 only
  • If you are using another operating system, feel free to make changes to an existing PHP source code

servbot's People

Contributors

madfxr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nilsonlinux

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.