Compare commits

...
Sign in to create a new pull request.

2 commits
dev ... main

Author SHA1 Message Date
hornet
8515e9c4a3 updoot readme v1.2 2024-12-27 21:51:18 +05:00
hornet
b09798cada updoot readme and version labels in the main file 2024-12-27 21:46:34 +05:00
2 changed files with 20 additions and 7 deletions

View file

@ -1,6 +1,8 @@
# lainmonitor
LainMonitor is a Telegram bot designed to monitor your system, providing real-time updates on the systems status, essential services, and disk usage. It can also verify connectivity to a specific Tailscale IP address.
Current version: v1.2
### Key Features:
Retrieve system information:
@ -11,9 +13,12 @@ LainMonitor is a Telegram bot designed to monitor your system, providing real-ti
Prosody
PostgreSQL
Tailscale
nginx
Check disk usage
Ping a Tailscale IP for connectivity verification
Accessible via Telegram commands such as /status, /ping, and /help
Restart critical services
Reboot the host
Accessible via Telegram commands
### Prerequisites:
@ -27,13 +32,20 @@ Clone the repository:
git clone https://git.lainlounge.xyz/hornet/lainmonitor.git
cd lainmonitor
RECOMMENDED: Create a virtual environment for python with:
```
python3 -m venv venv
source venv/bin/activate
```
Install dependencies:
pip3 install pyTelegramBotAPI
```
pip3 install -r requirements.txt
```
Configure your bot token: Open the lainmonitor.py file and replace the placeholder with your Telegram bot token:
Configure your bot token: Open the .env file and replace the placeholder with your Telegram bot token.
TOKEN = 'YOUR_BOT_TOKEN'
Configure authorized users: Open the .authorized_users file and replace the placeholders with Telegram user ID(s).
Set up service access: Ensure the bot can check system services by running it with sudo or appropriate permissions.
@ -76,7 +88,8 @@ Enable and start the service:
/help — Display a list of available commands.
/status — Retrieve system hostname, uptime, and status of monitored services.
/ping — Ping a Tailscale IP and return connectivity status.
/reboot — (Work in progress) Placeholder for a system reboot command.
/restart hostname- Restart a specific service on a specified machine.
/reboot hostname — Placeholder for a system reboot command.
### Contributions:

View file

@ -4,7 +4,7 @@
# usage: python3 lainmonitor.py | or run it as a service
# author: hornetmaidan
# contributors: h@x
# version: 1.1.6
# version: 1.2
import os
import subprocess
import threading
@ -161,7 +161,7 @@ def handle(message):
bot.reply_to(message, 'You are not authorized for this action')
else:
if message.text == '/start':
bot.reply_to(message, 'lainmonitor v1.0 --- standing by...')
bot.reply_to(message, 'lainmonitor v1.2 --- standing by...')
elif message.text == '/help':
bot.reply_to(message, 'commands: /start, /help, /status, /restart, /reboot, /ping')
bot.reply_to(message, 'commands: /start, /help, /status, /restart, /reboot, /ping')