Package: openvpn-monitor
openvpn-monitorSummaryopenvpn-monitor is a simple python program to generate html that displays the
status of an OpenVPN server, including all current connections. It uses the
OpenVPN management console. It typically runs on the same host as the OpenVPN
server, however it does not necessarily need to.SourceThe current source code is available on github:https://github.com/furlongm/openvpn-monitorInstall Optionsvirtualenv + pip + gunicornapachedockernginx + uwsgideb/rpmN.B. all CentOS/RHEL instructions assume the EPEL repository has been installed:yuminstall-yepel-releasevirtualenv + pip + gunicorn# apt-get install python-virtualenv geoip-database-extra geoipupdate      # (debian/ubuntu)# yum install python-virtualenv GeoIP-update geolite2-city python2-geoip2 # (centos/rhel)mkdir/srv/openvpn-monitorcd/srv/openvpn-monitor
virtualenv.
.bin/activate
pipinstall--upgradepip
pipinstallopenvpn-monitorgunicorn
gunicornopenvpn-monitor-b0.0.0.0:80Seeconfigurationfor details on configuring openvpn-monitor.apacheInstall dependencies and configure apacheDebian / Ubuntuapt-get-yinstallgitapache2libapache2-mod-wsgipython-geoip2python-ipaddrpython-humanizepython-bottlepython-semantic-versiongeoip-database-extrageoipupdateecho"WSGIScriptAlias /openvpn-monitor /var/www/html/openvpn-monitor/openvpn-monitor.py">/etc/apache2/conf-available/openvpn-monitor.conf
a2enconfopenvpn-monitor
systemctlrestartapache2CentOS / RHELyuminstall-ygithttpdmod_wsgipython2-geoip2python-ipaddrpython-humanizepython-bottlepython-semantic_versiongeolite2-cityGeoIP-updateecho"WSGIScriptAlias /openvpn-monitor /var/www/html/openvpn-monitor/openvpn-monitor.py">/etc/httpd/conf.d/openvpn-monitor.conf
systemctlrestarthttpdCheckout openvpn-monitorcd/var/www/html
gitclonehttps://github.com/furlongm/openvpn-monitor.gitSeeconfigurationfor details on configuring openvpn-monitor.dockerdockerrun-p80:80ruimarinho/openvpn-monitorRead thedocker installation instructionsfor details on how to generate a dynamic configuration using only environment
variables.nginx + uwsgiInstall dependencies# apt-get install gcc libgeoip-dev python-virtualenv python-dev geoip-database-extra nginx uwsgi uwsgi-plugin-python geoipupdate                  # (debian/ubuntu)# yum install gcc geoip-devel python-virtualenv python-devel GeoIP-data GeoIP-update nginx uwsgi uwsgi-plugin-python geolite2-city python2-geoip2 # (centos/rhel)Checkout openvpn-monitorcd/srv
gitclonehttps://github.com/furlongm/openvpn-monitor.gitcdopenvpn-monitor
virtualenv.
.bin/activate
pipinstall-rrequirements.txtuWSGI app configCreate a uWSGI config in/etc/uwsgi/apps-available/openvpn-monitor.ini[uwsgi]
base = /srv
project = openvpn-monitor
logto = /var/log/uwsgi/app/%(project).log
plugins = python
chdir = %(base)/%(project)
virtualenv = %(chdir)
module = openvpn-monitor:application
manage-script-name = true
mount=/openvpn-monitor=openvpn-monitor.pyNginx site configCreate an Nginx config in/etc/nginx/sites-available/openvpn-monitorserver {
    listen 80;
    location /openvpn-monitor/ {
        uwsgi_pass unix:///run/uwsgi/app/openvpn-monitor/socket;
        include uwsgi_params;
    }
}Enable uWSGI app and Nginx site, and restart servicesln-s/etc/uwsgi/apps-available/openvpn-monitor.ini/etc/uwsgi/apps-enabled/
serviceuwsgirestart
ln-s/etc/nginx/sites-available/openvpn-monitor/etc/nginx/sites-enabled/
servicenginxreloadSeeconfigurationfor details on configuring openvpn-monitor.deb / rpmTBDConfigurationConfigure OpenVPNAdd the following line to your OpenVPN server configuration to run the
management console on 127.0.0.1 port 5555, with the management password
in /etc/openvpn/pw-file:management 127.0.0.1 5555 pw-fileTo run the management console on a socket, with the management password
in /etc/openvpn/pw-file:management socket-name unix pw-fileRefer to the OpenVPN documentation for further information on how to secure
access to the management interface.Configure openvpn-monitorCopy the example configuration fileopenvpn-monitor.conf.exampleto the same
directory as openvpn-monitor.py.cpopenvpn-monitor.conf.exampleopenvpn-monitor.confIn this file you can set site name, add a logo, set the default map location
(latitude and longitude). If not set, the default location is New York, USA.Once configured, navigate tohttp://myipaddress/openvpn-monitor/Note the trailing slash, the images may not appear without it.Debuggingopenvpn-monitor can be run from the command line in order to test if the html
generates correctly:cd/var/www/html/openvpn-monitor
pythonopenvpn-monitor.pyFurther debugging can be enabled by specifying the--debugflag:cd/var/www/html/openvpn-monitor
pythonopenvpn-monitor.py-dLicenseopenvpn-monitor is licensed under the GPLv3, a copy of which can be found in
the COPYING file.AcknowledgementsFlags are created by Matthias Slovig (flags@slovig.de) and are licensed under
Creative Commons License Deed Attribution-ShareAlike 3.0 Unported
(CC BY-SA 3.0). Seehttp://flags.blogpotato.de/for more details.