INFO: Using config file: ./openvpn-monitor.conf
DEBUG:
=== begin section
{'site': 'Marco', 'latitude': '51.142060', 'longitude': '3.141928', 'maps': 'True', 'maps_height': '1500', 'geoip_data': '/usr/share/GeoIP/GeoLite2-City.mmdb', 'datetime_format': '%d/%m/%Y %H:%M:%S'}
=== end section
DEBUG:
=== begin section
{'host': 'localhost', 'port': '17562', 'name': 'Staff VPN', 'password': '', 'show_disconnect': False}
=== end section
WARNING: No compatible geoip1 or geoip2 data/libraries found.
INFO: Sending command: version
DEBUG:
=== begin raw data
OpenVPN Version: OpenVPN 2.5.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 6 2023
Management Version: 3
END
=== end raw data
INFO: Sending command: state
DEBUG:
=== begin raw data
1697531859,CONNECTED,SUCCESS,10.100.0.1,,,,
END
=== end raw data
DEBUG:
=== begin split line
['1697531859', 'CONNECTED', 'SUCCESS', '10.100.0.1', '', '', '', '']
=== end split line
DEBUG:
=== begin split line
['END']
=== end split line
INFO: Sending command: load-stats
DEBUG:
=== begin raw data
SUCCESS: nclients=1,bytesin=31447,bytesout=51676
=== end raw data
DEBUG:
=== begin split line
['nclients=1', 'bytesin=31447', 'bytesout=51676\r\n']
=== end split line
INFO: Sending command: status 3
DEBUG:
=== begin raw data
TITLE OpenVPN 2.5.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 6 2023
TIME 2023-10-17 16:08:04 1697551684
HEADER CLIENT_LIST Common Name Real Address Virtual Address Virtual IPv6 Address Bytes Received Bytes Sent Connected Since Connected Since (time_t) Username Client ID Peer ID Data Channel Cipher
CLIENT_LIST marc 94.109.136.74:9050 10.100.0.6 7189 9706 2023-10-17 16:00:32 1697551232 UNDEF 2 0 AES-256-GCM
HEADER ROUTING_TABLE Virtual Address Common Name Real Address Last Ref Last Ref (time_t)
ROUTING_TABLE 10.100.0.6 marc 94.109.136.74:9050 2023-10-17 16:05:05 1697551505
GLOBAL_STATS Max bcast/mcast queue length 1
END
=== end raw data
DEBUG:
=== begin split line
deque(['TITLE', 'OpenVPN 2.5.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 6 2023'])
=== end split line
DEBUG:
=== begin split line
deque(['TIME', '2023-10-17 16:08:04', '1697551684'])
=== end split line
DEBUG:
=== begin split line
deque(['HEADER', 'CLIENT_LIST', 'Common Name', 'Real Address', 'Virtual Address', 'Virtual IPv6 Address', 'Bytes Received', 'Bytes Sent', 'Connected Since', 'Connected Since (time_t)', 'Username', 'Client ID', 'Peer ID', 'Data Channel Cipher'])
=== end split line
DEBUG:
=== begin split line
deque(['CLIENT_LIST', 'marc', '94.109.136.74:9050', '10.100.0.6', '', '7189', '9706', '2023-10-17 16:00:32', '1697551232', 'UNDEF', '2', '0', 'AES-256-GCM'])
=== end split line
DEBUG:
=== begin split line
deque(['HEADER', 'ROUTING_TABLE', 'Virtual Address', 'Common Name', 'Real Address', 'Last Ref', 'Last Ref (time_t)'])
=== end split line
DEBUG:
=== begin split line
deque(['ROUTING_TABLE', '10.100.0.6', 'marc', '94.109.136.74:9050', '2023-10-17 16:05:05', '1697551505'])
=== end split line
DEBUG:
=== begin split line
deque(['GLOBAL_STATS', 'Max bcast/mcast queue length', '1'])
=== end split line
DEBUG:
=== begin split line
deque(['END'])
=== end split line
DEBUG:
=== begin sessions
{'10.100.0.6': {'bytes_recv': 7189,
'bytes_sent': 9706,
'client_id': '2',
'connected_since': datetime.datetime(2023, 10, 17, 16, 0, 32),
'last_seen': datetime.datetime(2023, 10, 17, 16, 5, 5),
'local_ip': IPv4Address('10.100.0.6'),
'peer_id': '0',
'port': 9050,
'remote_ip': IPv4Address('94.109.136.74'),
'username': 'marc'}}
=== end sessions
DEBUG:
=== begin vpns
{'VPN1': {'host': 'localhost',
'name': 'Staff VPN',
'password': '',
'port': '17562',
'release': 'OpenVPN 2.5.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] '
'[LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 6 2023',
'sessions': {'10.100.0.6': {'bytes_recv': 7189,
'bytes_sent': 9706,
'client_id': '2',
'connected_since': datetime.datetime(2023, 10, 17, 16, 0, 32),
'last_seen': datetime.datetime(2023, 10, 17, 16, 5, 5),
'local_ip': IPv4Address('10.100.0.6'),
'peer_id': '0',
'port': 9050,
'remote_ip': IPv4Address('94.109.136.74'),
'username': 'marc'}},
'show_disconnect': False,
'socket_connected': True,
'state': {'connected': 'CONNECTED',
'local_ip': IPv4Address('10.100.0.1'),
'mode': 'Server',
'remote_ip': '',
'success': 'SUCCESS',
'up_since': datetime.datetime(2023, 10, 17, 10, 37, 39)},
'stats': {'bytesin': 31447, 'bytesout': 51676, 'nclients': 1},
'version': Version('2.5.6')}}
=== end vpns
Content-Type: text/html
<!doctype html>
Marco OpenVPN Status Monitor
Staff VPN
VPN Mode
Status
Pingable
Clients
Total Bytes In
Total Bytes Out
Up Since
Local IP Address
Server
CONNECTED
Yes
1
31447 (30.7 KiB)
51676 (50.5 KiB)
17/10/2023 10:37:39
10.100.0.1
Username / Hostname
VPN IP
Remote IP
Location
Bytes In
Bytes Out
Connected Since
Last Ping
Time Online
marc
10.100.0.6
94.109.136.74
Unknown
7189 (7.0 KiB)
9706 (9.5 KiB)
17/10/2023 16:00:32
17/10/2023 16:05:05
0:07:32
Map View
Page automatically reloads every 5 minutes.
Last update: 17/10/2023 16:08:04
get unknown location on gentoo system. on ubuntu ok.
openvpn-monitor .conf:
`[openvpn-monitor] site=Marco
logo=logo.jpg
latitude=51.142060 longitude=3.141928 maps=True maps_height=1500 geoip_data=/usr/share/GeoIP/GeoLite2-City.mmdb
geoip_data=/usr/share/GeoIP/GeoIPCity.dat
datetime_format=%d/%m/%Y %H:%M:%S
[VPN1] host=localhost port=17562 name=Staff VPN password= show_disconnect=False`
ls /usr/share/GeoIP/ GeoIP.dat GeoIPCity.dat GeoIPv6.dat GeoLite2-City.mmdb
localhost /var/www/html/openvpn-monitor # ./openvpn-monitor.py -d > openvpn-monitor.log 2>&
INFO: Using config file: ./openvpn-monitor.conf DEBUG: === begin section {'site': 'Marco', 'latitude': '51.142060', 'longitude': '3.141928', 'maps': 'True', 'maps_height': '1500', 'geoip_data': '/usr/share/GeoIP/GeoLite2-City.mmdb', 'datetime_format': '%d/%m/%Y %H:%M:%S'} === end section DEBUG: === begin section {'host': 'localhost', 'port': '17562', 'name': 'Staff VPN', 'password': '', 'show_disconnect': False} === end section WARNING: No compatible geoip1 or geoip2 data/libraries found. INFO: Sending command: version
DEBUG: === begin raw data OpenVPN Version: OpenVPN 2.5.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 6 2023 Management Version: 3 END
=== end raw data INFO: Sending command: state
DEBUG: === begin raw data 1697531859,CONNECTED,SUCCESS,10.100.0.1,,,, END
=== end raw data DEBUG: === begin split line ['1697531859', 'CONNECTED', 'SUCCESS', '10.100.0.1', '', '', '', ''] === end split line DEBUG: === begin split line ['END'] === end split line INFO: Sending command: load-stats
DEBUG: === begin raw data SUCCESS: nclients=1,bytesin=31447,bytesout=51676
=== end raw data DEBUG: === begin split line ['nclients=1', 'bytesin=31447', 'bytesout=51676\r\n'] === end split line INFO: Sending command: status 3
DEBUG: === begin raw data TITLE OpenVPN 2.5.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 6 2023 TIME 2023-10-17 16:08:04 1697551684 HEADER CLIENT_LIST Common Name Real Address Virtual Address Virtual IPv6 Address Bytes Received Bytes Sent Connected Since Connected Since (time_t) Username Client ID Peer ID Data Channel Cipher CLIENT_LIST marc 94.109.136.74:9050 10.100.0.6 7189 9706 2023-10-17 16:00:32 1697551232 UNDEF 2 0 AES-256-GCM HEADER ROUTING_TABLE Virtual Address Common Name Real Address Last Ref Last Ref (time_t) ROUTING_TABLE 10.100.0.6 marc 94.109.136.74:9050 2023-10-17 16:05:05 1697551505 GLOBAL_STATS Max bcast/mcast queue length 1 END
=== end raw data DEBUG: === begin split line deque(['TITLE', 'OpenVPN 2.5.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 6 2023']) === end split line DEBUG: === begin split line deque(['TIME', '2023-10-17 16:08:04', '1697551684']) === end split line DEBUG: === begin split line deque(['HEADER', 'CLIENT_LIST', 'Common Name', 'Real Address', 'Virtual Address', 'Virtual IPv6 Address', 'Bytes Received', 'Bytes Sent', 'Connected Since', 'Connected Since (time_t)', 'Username', 'Client ID', 'Peer ID', 'Data Channel Cipher']) === end split line DEBUG: === begin split line deque(['CLIENT_LIST', 'marc', '94.109.136.74:9050', '10.100.0.6', '', '7189', '9706', '2023-10-17 16:00:32', '1697551232', 'UNDEF', '2', '0', 'AES-256-GCM']) === end split line DEBUG: === begin split line deque(['HEADER', 'ROUTING_TABLE', 'Virtual Address', 'Common Name', 'Real Address', 'Last Ref', 'Last Ref (time_t)']) === end split line DEBUG: === begin split line deque(['ROUTING_TABLE', '10.100.0.6', 'marc', '94.109.136.74:9050', '2023-10-17 16:05:05', '1697551505']) === end split line DEBUG: === begin split line deque(['GLOBAL_STATS', 'Max bcast/mcast queue length', '1']) === end split line DEBUG: === begin split line deque(['END']) === end split line DEBUG: === begin sessions {'10.100.0.6': {'bytes_recv': 7189, 'bytes_sent': 9706, 'client_id': '2', 'connected_since': datetime.datetime(2023, 10, 17, 16, 0, 32), 'last_seen': datetime.datetime(2023, 10, 17, 16, 5, 5), 'local_ip': IPv4Address('10.100.0.6'), 'peer_id': '0', 'port': 9050, 'remote_ip': IPv4Address('94.109.136.74'), 'username': 'marc'}} === end sessions DEBUG: === begin vpns {'VPN1': {'host': 'localhost', 'name': 'Staff VPN', 'password': '', 'port': '17562', 'release': 'OpenVPN 2.5.6 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] ' '[LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 6 2023', 'sessions': {'10.100.0.6': {'bytes_recv': 7189, 'bytes_sent': 9706, 'client_id': '2', 'connected_since': datetime.datetime(2023, 10, 17, 16, 0, 32), 'last_seen': datetime.datetime(2023, 10, 17, 16, 5, 5), 'local_ip': IPv4Address('10.100.0.6'), 'peer_id': '0', 'port': 9050, 'remote_ip': IPv4Address('94.109.136.74'), 'username': 'marc'}}, 'show_disconnect': False, 'socket_connected': True, 'state': {'connected': 'CONNECTED', 'local_ip': IPv4Address('10.100.0.1'), 'mode': 'Server', 'remote_ip': '', 'success': 'SUCCESS', 'up_since': datetime.datetime(2023, 10, 17, 10, 37, 39)}, 'stats': {'bytesin': 31447, 'bytesout': 51676, 'nclients': 1}, 'version': Version('2.5.6')}} === end vpns Content-Type: text/html
<!doctype html>
Staff VPN
Map View