Skip to content

"ServerStatusTelegramBot" is a repository featuring a Bash script that monitors server availability via a specified port. Using Telegram's API, it sends alerts about status changes, ensuring swift awareness of downtime and uptime.

Notifications You must be signed in to change notification settings

Shra1V32/serverStatusTelegramBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Server Status Telegram Bot

This Bash script monitors the availability of a server by checking the status of a specified port. It utilizes the Telegram bot API to send informative messages to a designated channel regarding the server's status changes.

Features

  • Monitors server availability by checking a specified port (port 2222 in this example).
  • Utilizes the Telegram bot API to send notifications about status changes.
  • Alerts are sent when the server goes down or comes back up.
  • Provides information about downtime and uptime durations.

Requirements

  • Bash
  • curl command-line tool

Setup

  1. Obtain a Telegram bot token from BotFather.
  2. Create a Telegram channel or group and obtain its ID.
  3. Replace the BOT_TOKEN and CHANNEL_ID in the script with your bot token and channel ID respectively.

Usage

  1. Make the script executable: chmod +x server_status_telegram_bot.sh
  2. Run the script: ./server_status_telegram_bot.sh

The script will continuously monitor the specified port and send Telegram messages to the designated channel whenever the server's status changes.

Customization

You can customize the script to monitor a different port or adjust the notification intervals by modifying the PORT and sleep values in the script.

About

"ServerStatusTelegramBot" is a repository featuring a Bash script that monitors server availability via a specified port. Using Telegram's API, it sends alerts about status changes, ensuring swift awareness of downtime and uptime.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

 

Languages