Skip to content

this script sends a json data to your api to monitor active connections and bandwidth.

Notifications You must be signed in to change notification settings

zbtechph/openvpn-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

openvpn-agent

this script sends a json data to your api to monitor active connections and bandwidth. data includes trusted_ip, bytes_received, bytes_sent, common_name, and script type (client-connect or client-disconnect) https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/#environmental-variables

ensure python3 is installed

requests python package is required for calling the api

pip3 install requests

first, clone or download this repository then edit agent.py

chmod agent.py

chmod +x ./openvpn-agent/agent.py

change endpoint value to your api endpoint.

add this line to your openvpn server config. usually, /etc/openvpn/server.conf

client-connect ./openvpn-agent/agent.py
client-disconnect ./openvpn-agent/agent.py

then restart openvpn

systemctl restart openvpn

note: bytes_sent and bytes_received will only return a value on client-disconnect script.

About

this script sends a json data to your api to monitor active connections and bandwidth.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages