How to monitor your server via Telegram + ThingSpeak

Keep servers monitored that we manage, it is an arduous but vital task, it is essential to know in depth what is happening in them, and that is why there are several tools that send notifications and manage them prudently. In this article you will learn how How to monitor your server via Telegram + ThingSpeak, by running a bot that will allow you to check the status of a server from Telegram.

What is TeleMonBot?

TeleMonBot is an open source script, made in Python by Egor Koshmin, that allows monitoring Windows and Linux servers via TelegramThingSpeak. That is, this script allows us to receive information in real time from our server from a Telegram bot.

With this script we will be able to know:

  • The percentage of ram used.
  • The percentage of CPU used.
  • The availability of the system.
  • The server time.
  • Take and send a screenshot of the server.
  • Know the geographic location of the server.
  • Among others.

How to create a bot on Telegram?

The easiest way to create a Telegram bot is adding to Bot Father from the application and then create the bot with the command: /newbot to which BotFather will request its name and finally it will generate a API Key that you must configure in the TeleMonBot

How to install TeleMonBot?

To install TeleMonBot We must follow the following steps:

  • Clone the official TeleMonBot repository on your computer:
    git clone https://github.com/EKOsh/TeleMonBot TeleMonBot && cd TeleMonBot
  • Install the necessary libraries + SQLite DB browser and create a DB for future logging:
    sudo chmod +x inst.sh && sudo ./inst.sh
  • Edit the file config.ini with the information of your telegram bot api code and optionally the thingspeak channel write code.
  • Run the Main of the script
    sudo python Main.py
    With ThingSpeak (In case you added the code):
    sudo python Main.py TS

    telemonbot

    telemonbot

How to use TeleMonBot to monitor your server?

Use TeleMonBot It's easy, once we have created our bot thanks to Bot Father, configured with the API Key corresponding to the script and running, we can already know a lot of information about our server from Telegram.

To ask the telegram bot we must use the following list of commands:

  • Returns the% of RAM used: RAM usage
  • Returns the% of CPU used: cpu-usage
  • Returns the server uptime: Uptime
  • Returns the server time: What is the time?
  • Send a screenshot of the server: Screenshot
  • Returns the location of the server: Where are you?
    Monitor your server

    Monitor your server

So, for finishing, It is worth noting that the consumption of this script is minimal, it is still under construction and its developer estimates that it will be constantly updated. It is a tool that all system administrators should evaluate and put into practice.

If you liked or found this information useful, do not hesitate to leave your comments.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Jordan said

    Good day,

    The article seems quite interesting to me, only I did not understand a part I do not know if they can help me, how do I configure this;

    "Edit the config.ini file with the information of your telegram bot api code and optionally the thingspeak channel write code."