From 93fb4f93d064c5e48a80aff89f95c4f77d605a85 Mon Sep 17 00:00:00 2001 From: hax Date: Fri, 25 Oct 2024 00:43:54 +0000 Subject: [PATCH] Updoot README V1.1.0 :) --- README.md | 109 +++++++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index c00ed87..505b39f 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,59 @@ # 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 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` + Retrieve system information: + Hostname + Uptime + Status of critical services: + Zerotier + Prosody + PostgreSQL + Tailscale + Check disk usage + Ping a Tailscale IP for connectivity verification + Accessible via Telegram commands such as /status, /ping, and /help -## Dependencies -- [Telebot](https://github.com/eternnoir/pyTelegramBotAPI) - A Python library for Telegram bot API. +### Prerequisites: + + 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 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 -You can run the bot directly using Python: +Configure your bot token: Open the lainmonitor.py file and replace the placeholder with your Telegram bot token: -```bash -python3 lainmonitor.py -``` + 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: + + 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 - ``` -2. Add the following configuration: - ```ini + +Add the following configuration: + [Unit] Description=LainMonitor Telegram Bot After=network.target @@ -59,21 +64,23 @@ To run LainMonitor as a service, follow these steps: [Install] WantedBy=multi-user.target - ``` -3. Enable and start the service: - ```bash + +Enable and start the service: + 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. +### Available Commands: -## Author -Created by **hornetmaidan** + /start — Initialize the bot and receive a welcome message. + /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! \ No newline at end of file +### Contributions: + +Created by hornetmaidan. +With Contributions from h@x. + +Any new features and suggestions are welcome! \ No newline at end of file