/Server-Monitoring-Telegram-Bot

The Server Monitoring Telegram Bot is a useful tool to monitor the uptime of servers and websites. It periodically checks the status of added URLs and sends notifications to users if any server or website is down or encounters an error.

Primary LanguageJavaScriptMIT LicenseMIT

Server Monitoring Telegram Bot by Harshit Sharma (HarshitEthic)

Hi, I am Harshit Sharma, also known as HarshitEthic. I have developed a Server Monitoring Telegram Bot to help users monitor their servers and websites. In this post, I will describe the code and how it works, and provide installation steps for setting up the bot on your own.

Description

The Server Monitoring Telegram Bot is a useful tool to monitor the uptime of servers and websites. It periodically checks the status of added URLs and sends notifications to users if any server or website is down or encounters an error.

Features

  • Built using Node.js and node-telegram-bot-api library
  • Easy to interact with the Telegram Bot API
  • Allows adding, listing, and monitoring URLs
  • Sends notifications to users if a server or website is down or encounters an error

Developer Information

Installation Steps

  1. Install Node.js if you haven't already: https://nodejs.org/
  2. Clone the repository or download the code.
  3. Open a terminal/command prompt and navigate to the folder containing the bot code.
  4. Run npm install to install the required dependencies.

Configuration

  1. Replace TOKEN_TELE with your own Telegram Bot API token in the code.
  2. Replace the chatId variable in the setInterval function with the user ID.

Usage

  1. Run node app.js (or the name of the file containing the bot code) in the terminal/command prompt to start the bot.
  2. Open Telegram and start a chat with your bot.
  3. Use the following commands:
    • /start: Sends a welcome message and introduces the bot.
    • /add <url>: Adds a server or website to be monitored.
    • /help: Shows a list of available commands and their descriptions.
    • /list: Displays the list of currently monitored URLs.
  4. The bot will automatically check the status of the monitored URLs every minute and send notifications if any server or website is down or encounters an error.

That's it! You have successfully set up and started using the Server Monitoring Telegram Bot by Harshit Sharma (HarshitEthic). Enjoy monitoring your servers and websites with ease!