Proper README created

Signed-off-by: hax <hax@lainlounge.xyz>
This commit is contained in:
h@x 2024-10-04 19:04:46 +00:00
parent 93c4c0d49e
commit 3bb01a384e

View file

@ -1,3 +1,79 @@
# lainmonitor
# LainMonitor Bot
telegram bot hosted on lainlounge servers for remote system monitoring
LainMonitor is a Telegram bot designed to monitor your system by providing real-time information about the system's status, services, and disk usage. It can also check connectivity to a specific Tailscale IP address.
## Features
- Retrieve system hostname, uptime, and status of essential services such as:
- Zerotier
- Prosody
- PostgreSQL
- Tailscale
- Check disk usage
- Ping a Tailscale IP to verify connectivity
- Use via Telegram commands like `/status`, `/ping`, and `/help`
## Dependencies
- [Telebot](https://github.com/eternnoir/pyTelegramBotAPI) - A Python library for Telegram bot API.
## Installation
1. Clone this repository:
```bash
git clone https://git.lainlounge.xyz/hornet/lainmonitor.git
cd lainmonitor
```
2. Install the required Python library:
```bash
pip install pyTelegramBotAPI
```
3. Replace the placeholder in the code with your Telegram bot token:
```python
TOKEN = 'PLACE_YOUR_TOKEN_HERE'
```
4. Set up permissions for the bot to check system services (run as a user with `sudo` access).
## Usage
### Running Directly
You can run the bot directly using Python:
```bash
python3 lainmonitor.py
```
### Running as a Service
To run LainMonitor as a service, follow these steps:
1. Create a systemd service file:
```bash
sudo nano /etc/systemd/system/lainmonitor.service
```
2. Add the following configuration:
```ini
[Unit]
Description=LainMonitor Telegram Bot
After=network.target
[Service]
ExecStart=/usr/bin/python3 /path/to/lainmonitor.py
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
3. Enable and start the service:
```bash
sudo systemctl enable lainmonitor
sudo systemctl start lainmonitor
```
## Telegram Bot Commands
- `/start`: Initialize the bot and receive a welcome message.
- `/help`: Display available commands.
- `/status`: Get the system hostname, status, uptime, and the status of monitored services.
- `/ping`: Ping a Tailscale IP and return the connectivity status.
- `/reboot`: (Work in progress) Placeholder for a reboot command.
## Author
Created by **hornetmaidan**
Feel free to contribute or suggest features!