All Projects → tonyseek → openvpn-status

tonyseek / openvpn-status

Licence: MIT license
Parse OpenVPN status logs in Python

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to openvpn-status

vpnman
A web-based frontend for OpenVPN server management
Stars: ✭ 32 (-59.49%)
Mutual labels:  openvpn, openvpn-monitor
Smartvpn Billing
Billing and auth system for VPN provider
Stars: ✭ 250 (+216.46%)
Mutual labels:  openvpn
Docker Openvpn
🔐 Out of the box stateless openvpn-server docker image which starts in less than 2 seconds
Stars: ✭ 174 (+120.25%)
Mutual labels:  openvpn
Django Netjsonconfig
Configuration manager for embedded devices, implemented as a reusable django-app
Stars: ✭ 213 (+169.62%)
Mutual labels:  openvpn
Tunnelkit
Non-official OpenVPN client library for Apple platforms.
Stars: ✭ 180 (+127.85%)
Mutual labels:  openvpn
Oh My Vpn
Setup your own OpenVPN server in 30 seconds!
Stars: ✭ 220 (+178.48%)
Mutual labels:  openvpn
Smartvpn Http Hooks
OpenVPN server hooks
Stars: ✭ 171 (+116.46%)
Mutual labels:  openvpn
openvpn-shapeshifter
This script will automatically guide you to install and configure your OpenVPN server with Shapeshifter Dispatcher (obfuscation) which will allow you to bypass the DPI blockage on OpenVPN. This setup will offer the users the freedom to choose between regular OpenVPN connection or obfuscated one, they actually can use both! OpenVPN is the VPN pro…
Stars: ✭ 59 (-25.32%)
Mutual labels:  openvpn
Pqcrypto Vpn
Post-quantum Cryptography VPN
Stars: ✭ 241 (+205.06%)
Mutual labels:  openvpn
Docker Transmission Openvpn
Docker container running Transmission torrent client with WebUI over an OpenVPN tunnel
Stars: ✭ 2,748 (+3378.48%)
Mutual labels:  openvpn
Openvpn Install
OpenVPN road warrior installer for Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS and Fedora
Stars: ✭ 14,199 (+17873.42%)
Mutual labels:  openvpn
Arch Rtorrentvpn
Docker build script for Arch Linux base with ruTorrent, rTorrent, autodl-irssi, Privoxy and OpenVPN
Stars: ✭ 185 (+134.18%)
Mutual labels:  openvpn
Openvpn Easy Setup
Bash script for easy and fast OpenVPN deploy
Stars: ✭ 230 (+191.14%)
Mutual labels:  openvpn
Openwrt Sfe Flowoffload Ath79
Openwrt firmware with SFE and FlowOffload
Stars: ✭ 178 (+125.32%)
Mutual labels:  openvpn
ceil
Helmut Hoffer von Ankershoffen experimenting with auto-provisioned RPi cluster running K8S on bare-metal
Stars: ✭ 42 (-46.84%)
Mutual labels:  openvpn
Config
Various program configuration files and scripts
Stars: ✭ 173 (+118.99%)
Mutual labels:  openvpn
Ics Openvpn
OpenVPN for Android
Stars: ✭ 2,357 (+2883.54%)
Mutual labels:  openvpn
Doxycannon
A poorman's proxycannon and botnet, using docker, ovpn files, and a dante socks5 proxy
Stars: ✭ 216 (+173.42%)
Mutual labels:  openvpn
alpine-qbittorrent-openvpn
qBittorrent docker container with OpenVPN client running as unprivileged user on alpine linux
Stars: ✭ 230 (+191.14%)
Mutual labels:  openvpn
openvpn-status-web
Small Rack (Ruby) application serving OpenVPN status file
Stars: ✭ 14 (-82.28%)
Mutual labels:  openvpn

Build Status Coverage Status PyPI Version Wheel Status

OpenVPN Status

openvpn-status is a Python library. It parses OpenVPN status log and turns it into Python data structure for you.

It is compatible with Python 2.7, 3.6 to 3.10, and PyPy.

Installation

pip install openvpn-status

Don't forget to put it in setup.py / requirements.txt.

Getting Started

You could configure your OpenVPN server to log for client status. In usual it could be achieved by adding status /path/to/openvpn-status.log line to /etc/openvpn/openvpn.conf. For example:

proto udp
port 1194
dev tun0
status /var/run/openvpn-status.log

Once OpenVPN server running, the log file will be created and written. It looks like:

OpenVPN CLIENT LIST
Updated,Thu Jun 18 08:12:15 2015
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
[email protected],10.10.10.10:49502,334948,1973012,Thu Jun 18 04:23:03 2015
[email protected],10.10.10.10:64169,1817262,28981224,Thu Jun 18 04:08:39 2015
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
192.168.255.134,[email protected],10.10.10.10:49502,Thu Jun 18 08:12:09 2015
192.168.255.126,[email protected],10.10.10.10:64169,Thu Jun 18 08:11:55 2015
GLOBAL STATS
Max bcast/mcast queue length,0
END

Now we could parse log file with this library:

from openvpn_status import parse_status

with open('/var/run/openvpn-status.log') as logfile:
    status = parse_status(logfile.read())

print(status.updated_at)  # datetime.datetime(2015, 6, 18, 8, 12, 15)

foo_client = status.client_list['169.254.0.1']
print(foo_client.common_name)  # [email protected]
print(foo_client.bytes_received)  # 334.9 kB
print(foo_client.bytes_sent)  # 2.0 MB
print(int(foo_client.bytes_sent))  # 2097152

More details are in the API reference.

Contributing

If you want to report bugs or request features, please feel free to open issues on GitHub.

Of course, pull requests are always welcome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].