Updoot README V1.1.0 :)

This commit is contained in:
h@x 2024-10-25 00:43:54 +00:00
parent ae07a3a86d
commit 93fb4f93d0

107
README.md
View file

@ -1,54 +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 systems 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 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). Install dependencies:
## Usage pip3 install pyTelegramBotAPI
### Running Directly Configure your bot token: Open the lainmonitor.py file and replace the placeholder with your Telegram bot token:
You can run the bot directly using Python:
TOKEN = 'YOUR_BOT_TOKEN'
Set up service access: Ensure the bot can check system services by running it with sudo or appropriate permissions.
### Usage:
#### Running the Bot Manually:
You can run LainMonitor directly from the command line:
```bash
python3 lainmonitor.py python3 lainmonitor.py
```
### Running as a Service #### Running as a Systemd Service:
To run LainMonitor as a service, follow these steps:
1. Create a systemd service file: To run the bot as a systemd service, follow these steps:
```bash
Create a service file:
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
@ -59,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 and return the connectivity status.
- `/reboot`: (Work in progress) Placeholder for a reboot command.
## Author /start — Initialize the bot and receive a welcome message.
Created by **hornetmaidan** /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!