Merge branch 'hax-readme_updoot' into dev
This commit is contained in:
commit
88b678da3b
1 changed files with 57 additions and 49 deletions
106
README.md
106
README.md
|
|
@ -1,53 +1,59 @@
|
||||||
# lainmonitor
|
# lainmonitor
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
### Key Features:
|
||||||
|
|
||||||
## Features
|
Retrieve system information:
|
||||||
- Retrieve system hostname, uptime, and status of essential services such as:
|
Hostname
|
||||||
- Zerotier
|
Uptime
|
||||||
- Prosody
|
Status of critical services:
|
||||||
- PostgreSQL
|
Zerotier
|
||||||
- Tailscale
|
Prosody
|
||||||
- Check disk usage
|
PostgreSQL
|
||||||
- Ping a Tailscale IP to verify connectivity
|
Tailscale
|
||||||
- Use via Telegram commands like `/status`, `/ping`, and `/help`
|
Check disk usage
|
||||||
|
Ping a Tailscale IP for connectivity verification
|
||||||
|
Accessible via Telegram commands such as /status, /ping, and /help
|
||||||
|
|
||||||
## Dependencies
|
### Prerequisites:
|
||||||
- [Telebot](https://github.com/eternnoir/pyTelegramBotAPI) - A Python library for Telegram bot API.
|
|
||||||
|
Python 3
|
||||||
|
Telebot — Python library for interacting with the Telegram bot API.
|
||||||
|
|
||||||
|
### Installation Guide:
|
||||||
|
|
||||||
|
Clone the repository:
|
||||||
|
|
||||||
## Installation
|
|
||||||
1. Clone this repository:
|
|
||||||
```bash
|
|
||||||
git clone https://git.lainlounge.xyz/hornet/lainmonitor.git
|
git clone https://git.lainlounge.xyz/hornet/lainmonitor.git
|
||||||
cd lainmonitor
|
cd lainmonitor
|
||||||
```
|
|
||||||
2. Install the required Python library:
|
|
||||||
```bash
|
|
||||||
pip install pyTelegramBotAPI
|
|
||||||
```
|
|
||||||
3. Replace the placeholder in the .env file with your Telegram bot token
|
|
||||||
|
|
||||||
4. Add the .env file to .gitignore to prevent token overwriting
|
Install dependencies:
|
||||||
|
|
||||||
4. Set up permissions for the bot to check system services (run as a user with `sudo` access).
|
pip3 install pyTelegramBotAPI
|
||||||
|
|
||||||
## Usage
|
Configure your bot token: Open the lainmonitor.py file and replace the placeholder with your Telegram bot token:
|
||||||
|
|
||||||
### Running Directly
|
TOKEN = 'YOUR_BOT_TOKEN'
|
||||||
You can run the bot directly using Python:
|
|
||||||
|
|
||||||
```bash
|
Set up service access: Ensure the bot can check system services by running it with sudo or appropriate permissions.
|
||||||
python3 lainmonitor.py
|
|
||||||
```
|
### Usage:
|
||||||
|
#### Running the Bot Manually:
|
||||||
|
|
||||||
|
You can run LainMonitor directly from the command line:
|
||||||
|
|
||||||
|
python3 lainmonitor.py
|
||||||
|
|
||||||
|
#### Running as a Systemd Service:
|
||||||
|
|
||||||
|
To run the bot as a systemd service, follow these steps:
|
||||||
|
|
||||||
|
Create a service file:
|
||||||
|
|
||||||
### 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
|
sudo nano /etc/systemd/system/lainmonitor.service
|
||||||
```
|
|
||||||
2. Add the following configuration:
|
Add the following configuration:
|
||||||
```ini
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=LainMonitor Telegram Bot
|
Description=LainMonitor Telegram Bot
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
@ -58,21 +64,23 @@ To run LainMonitor as a service, follow these steps:
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
```
|
|
||||||
3. Enable and start the service:
|
Enable and start the service:
|
||||||
```bash
|
|
||||||
sudo systemctl enable lainmonitor
|
sudo systemctl enable lainmonitor
|
||||||
sudo systemctl start lainmonitor
|
sudo systemctl start lainmonitor
|
||||||
```
|
|
||||||
|
|
||||||
## Telegram Bot Commands
|
### Available 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 subnet and return the connectivity status for each peer.
|
|
||||||
- `/reboot`: (Work in progress) Placeholder for a reboot command.
|
|
||||||
|
|
||||||
## Author
|
/start — Initialize the bot and receive a welcome message.
|
||||||
Created by **hornet** and **hax**
|
/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.
|
||||||
|
|
||||||
Feel free to contribute or suggest features!
|
### Contributions:
|
||||||
|
|
||||||
|
Created by hornetmaidan.
|
||||||
|
With Contributions from h@x.
|
||||||
|
|
||||||
|
Any new features and suggestions are welcome!
|
||||||
Loading…
Add table
Reference in a new issue