Giter Club home page Giter Club logo

pyopenvpn-monitor's Introduction

OpenVPN Status Monitor

OpenVPN Status Monitor is a Python-based bot that monitors the status of an OpenVPN server and sends updates to a specified Telegram channel.

Features

  • Real-time monitoring of OpenVPN status log.
  • Notification of new connections and disconnections.
  • Whitelist access control for privileged bot commands.

Installation

Clone the repository.

git clone https://github.com/username/openvpn-status-monitor.git

Navigate to the project directory.

cd openvpn-status-monitor

Install the Python package.

pip install .

Docker Deployment

Build the Docker image.

docker build -t pyopenvpn-monitor .

Start the Docker container.

docker run --rm -it pyopenvpn-monitor -h

Configuration

Configuration of the OpenVPN Status Monitor is done via environment variables which can be placed in a .env file. An example .env file is provided in the repository. Please make sure to replace the placeholders with your actual values.

# .env example
TOKEN=your_telegram_token
OPENVPN_STATUS_LOG_FILE=/path/to/openvpn/status.log
WHITELIST=whitelisted_telegram_usernames_separated_by_comma

Please note that the OPENVPN_STATUS_LOG_FILE environment variable refers to the OpenVPN status log file inside the Docker container. Therefore, you have to ensure that the status log file of your OpenVPN server is properly mounted into the Docker container using Docker volumes.

The docker-compose file provided in the repository uses this environment variable to correctly mount your OpenVPN status log file.

Usage

  • /start command: Start monitoring the connection logs.
  • /stats command: Print current statistics from the OpenVPN server.
  • /help command: Show help message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.