server-watchdog 0.1.0

A server monitoring and remote control tool via messenger.
Documentation

Server Watchdog

A server monitoring and remote control tool via messenger.

Table of Contents

Features

  • Monitor server health and logs.
  • Remote control servers via messenger bots (e.g., Telegram).
  • Get notified when specific keywords are found in server logs or health checks.
  • Secure access with password-based authentication.

Installation

To build the project, you need Rust and Cargo installed. If you don't have them, you can install them from rust-lang.org.

Once Rust and Cargo are installed, clone the repository and build the project:

cargo install server-watchdog 

If you encounter issues during installation, please refer to the Troubleshooting Guide.

Configuration

The server-watchdog CLI is used to configure the application.

Server Management

  • Add a server:
    server-watchdog server add
    
  • List servers:
    server-watchdog server list
    

Client Management

  • Add a client:
    server-watchdog client add
    
  • List clients:
    server-watchdog client list
    

Event Management

  • Add an event:
    server-watchdog event add
    
    You will be prompted to enter the event's details (name, type, target server, keyword).
  • List events:
    server-watchdog event list
    
  • Remove an event:
    server-watchdog event remove <event_name>
    

Password Management

  • Set the password:
    server-watchdog password set <password>
    

Usage

Available Commands

Once the watchdog is running, you can interact with it through the configured messenger client (e.g., Telegram).

  • /register <password>: Registers you to use the bot.

    • password: The password you set for the bot.
  • /alarm add <event_name>: Adds an alarm for a pre-configured event.

  • /alarm remove <event_name>: Removes an alarm for a pre-configured event.

  • /alarm list: Lists all active alarms.

  • /event [list]: Lists all configured events.

    • list (optional): Displays a list of all configured events. If omitted, acts the same as /event list.
  • /logs <server_name> <lines>: Fetches the last <lines> of logs from the specified server.

    • server_name: The name you assigned to the server.
    • lines: The number of log lines to retrieve.
  • /health [server_name]: Checks the health of the specified server. If no server name is provided, it will check all registered servers.

    • server_name (optional): The name you assigned to the server.

Running the Watchdog

To start the server watchdog application:

server-watchdog run