Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8515e9c4a3 | ||
|
|
b09798cada |
2 changed files with 20 additions and 7 deletions
23
README.md
23
README.md
|
|
@ -1,6 +1,8 @@
|
||||||
# lainmonitor
|
# lainmonitor
|
||||||
|
|
||||||
LainMonitor is a Telegram bot designed to monitor your system, providing real-time updates on the system’s status, essential services, and disk usage. It can also verify connectivity to a specific Tailscale IP address.
|
LainMonitor is a Telegram bot designed to monitor your system, providing real-time updates on the system’s status, essential services, and disk usage. It can also verify connectivity to a specific Tailscale IP address.
|
||||||
|
Current version: v1.2
|
||||||
|
|
||||||
### Key Features:
|
### Key Features:
|
||||||
|
|
||||||
Retrieve system information:
|
Retrieve system information:
|
||||||
|
|
@ -11,9 +13,12 @@ LainMonitor is a Telegram bot designed to monitor your system, providing real-ti
|
||||||
Prosody
|
Prosody
|
||||||
PostgreSQL
|
PostgreSQL
|
||||||
Tailscale
|
Tailscale
|
||||||
|
nginx
|
||||||
Check disk usage
|
Check disk usage
|
||||||
Ping a Tailscale IP for connectivity verification
|
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:
|
### Prerequisites:
|
||||||
|
|
||||||
|
|
@ -27,13 +32,20 @@ Clone the repository:
|
||||||
git clone https://git.lainlounge.xyz/hornet/lainmonitor.git
|
git clone https://git.lainlounge.xyz/hornet/lainmonitor.git
|
||||||
cd lainmonitor
|
cd lainmonitor
|
||||||
|
|
||||||
|
RECOMMENDED: Create a virtual environment for python with:
|
||||||
|
```
|
||||||
|
python3 -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
```
|
||||||
Install dependencies:
|
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.
|
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.
|
/help — Display a list of available commands.
|
||||||
/status — Retrieve system hostname, uptime, and status of monitored services.
|
/status — Retrieve system hostname, uptime, and status of monitored services.
|
||||||
/ping — Ping a Tailscale IP and return connectivity status.
|
/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:
|
### Contributions:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# usage: python3 lainmonitor.py | or run it as a service
|
# usage: python3 lainmonitor.py | or run it as a service
|
||||||
# author: hornetmaidan
|
# author: hornetmaidan
|
||||||
# contributors: h@x
|
# contributors: h@x
|
||||||
# version: 1.1.6
|
# version: 1.2
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import threading
|
import threading
|
||||||
|
|
@ -161,7 +161,7 @@ def handle(message):
|
||||||
bot.reply_to(message, 'You are not authorized for this action')
|
bot.reply_to(message, 'You are not authorized for this action')
|
||||||
else:
|
else:
|
||||||
if message.text == '/start':
|
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':
|
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')
|
||||||
bot.reply_to(message, 'commands: /start, /help, /status, /restart, /reboot, /ping')
|
bot.reply_to(message, 'commands: /start, /help, /status, /restart, /reboot, /ping')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue