You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems my version of OpenVPN (2.5.1) has more fields in the client list than what is expected, which causes an exception while getting the client list from the parser object:
>>> from openvpn_status_parser import OpenVPNStatusParser
>>> import pprint
>>> parser = OpenVPNStatusParser("/tmp/status.log")
>>> pprint.pprint(parser.connected_clients)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nicolas/git/openvpn-status-parser/openvpn_status_parser/__init__.py", line 141, in connected_clients
self._parse_file()
File "/home/nicolas/git/openvpn-status-parser/openvpn_status_parser/__init__.py", line 120, in _parse_file
self.title_processors[row_title](row)
File "/home/nicolas/git/openvpn-status-parser/openvpn_status_parser/__init__.py", line 83, in _process_client_list
self._connected_clients[row[1]]["connected_since"] = (datetime.datetime.fromtimestamp(int(row[-1])))
ValueError: invalid literal for int() with base 10: 'AES-256-CBC'
My OpenVPN server is configured with option "status-version 3".
Here is the (anonymized) status file :
TITLE OpenVPN 2.5.1 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2021
TIME 2021-12-16 16:13:52 1639667632
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 UNDEF 1.2.3.4:56736 10.42.42.2 67638680 45432322 2021-12-14 10:34:46 1639474486 my_user 609 0 AES-256-CBC
HEADER ROUTING_TABLE Virtual Address Common Name Real Address Last Ref Last Ref (time_t)
ROUTING_TABLE 96:03:2d:9d:0d:40@0 UNDEF 1.2.3.4:56736 2021-12-16 16:13:51 1639667631
GLOBAL_STATS Max bcast/mcast queue length 1
END
The issue is caused because openvpn-status-parser is expecting the "Connected Since (time_t)" to be the last field ( row[-1])
I'll submit a PR fixing this.
The text was updated successfully, but these errors were encountered:
N-Mi
linked a pull request
Dec 16, 2021
that will
close
this issue
It seems my version of OpenVPN (2.5.1) has more fields in the client list than what is expected, which causes an exception while getting the client list from the parser object:
My OpenVPN server is configured with option "status-version 3".
Here is the (anonymized) status file :
The issue is caused because openvpn-status-parser is expecting the "Connected Since (time_t)" to be the last field (
row[-1]
)I'll submit a PR fixing this.
The text was updated successfully, but these errors were encountered: