Compare commits

..

No commits in common. "main" and "dev" have entirely different histories.
main ... dev

2 changed files with 7 additions and 20 deletions

View file

@ -1,8 +1,6 @@
# 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:
@ -13,12 +11,9 @@ Current version: v1.2
Prosody
PostgreSQL
Tailscale
nginx
Check disk usage
Ping a Tailscale IP for connectivity verification
Restart critical services
Reboot the host
Accessible via Telegram commands
Accessible via Telegram commands such as /status, /ping, and /help
### Prerequisites:
@ -32,20 +27,13 @@ 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 -r requirements.txt
```
pip3 install pyTelegramBotAPI
Configure your bot token: Open the .env file and replace the placeholder with your Telegram bot token.
Configure your bot token: Open the lainmonitor.py file and replace the placeholder with your Telegram bot token:
Configure authorized users: Open the .authorized_users file and replace the placeholders with Telegram user ID(s).
TOKEN = 'YOUR_BOT_TOKEN'
Set up service access: Ensure the bot can check system services by running it with sudo or appropriate permissions.
@ -88,8 +76,7 @@ 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.
/restart hostname- Restart a specific service on a specified machine.
/reboot hostname — Placeholder for a system reboot command.
/reboot — (Work in progress) 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.2
# version: 1.1.6
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.2 --- standing by...')
bot.reply_to(message, 'lainmonitor v1.0 --- 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')