Description of the Python application:
Name: Server Info Telegram Bot
Description:
Server Info Telegram Bot is a simple and effective application written in Python,
which allows you to send system information from the server to users specified in the configuration file.
The application automatically extracts the login of the current user,
local IP address and generates a command for connecting via SSH.
All necessary parameters, such as token and chat IDs, are stored and configured in the configuration file.
You can add this application to autorun on your server to get the necessary information in tg when running.
This can be especially useful on home computers,
which many people sometimes use as a test server or a server for hosting telegram bots.
Main functions:
- Sending notifications to specified Telegram chats.
- Automatically receiving user login and local IP address.
- Forming an SSH command for remote connection.
- Customizable configuration file for ease of use.
Requirements:
- Python 3.x
Installation:
- Clone the repository.
- Create a
config.json
file in your project folder.
Exemple config.json
:
{
"token": "your telegram token",
"admins": [
"chat_id1",
"chat_id1"
]
}
-
Add the bot's token to the file, and the chat IDs of those to whom the bot will send messages.
-
Run the application.
python app.py
Images:
Description of the Bash script (.sh):
Description:
The Bash version of Telegram SSH Notifier performs the same functions as the Python application,
but is written as a Bash script. This script allows you to send notifications to Telegram,
including the user login, local IP address, and the generated command for connecting via SSH.
All parameters are also configured through the configuration file.
Main functions:
- Sending notifications to specified Telegram chats.
- Automatically receiving user login and local IP address.
- Forming an SSH command for remote connection.
- Customizable configuration file for ease of use.
Requirements:
- Bash (usually pre-installed on most Unix-like systems).
curl
orwget
utilities for sending requests to the Telegram API.
Installation:
- Clone the repository.
- Create a
config.ini
file in your project folder.
Exemple config.ini
:
# Token for the Telegram bot
token=your telegram token
# Admin chat IDs
admins=chat_id1,chat_id2
- Add the bot's token to the file, and the chat IDs of those to whom the bot will send messages.
- Make the script executable with
chmod +x app.sh
. - Run the application.
. app.sh