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
- Name: Harshit Sharma
- Nickname: HarshitEthic
- Instagram: https://www.instagram.com/HarshitEthic/
- GitHub: https://github.com/HarshitEthic
- Personal website: https://harshitethic.in/
Installation Steps
- Install Node.js if you haven't already: https://nodejs.org/
- Clone the repository or download the code.
- Open a terminal/command prompt and navigate to the folder containing the bot code.
- Run
npm install
to install the required dependencies.
Configuration
- Replace
TOKEN_TELE
with your own Telegram Bot API token in the code. - Replace the
chatId
variable in thesetInterval
function with the user ID.
Usage
- Run
node app.js
(or the name of the file containing the bot code) in the terminal/command prompt to start the bot. - Open Telegram and start a chat with your bot.
- Use the following commands:
/start
: Sends a welcome message and introduces the bot./add <url>
: Adds a server or website to be monitored./list
: Displays the list of currently monitored URLs.
/help
: Shows a list of available commands and their descriptions. - 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!