Skip to content

Fix OpenVPN client traffic and maxclients calculation#71

Open
smeinecke wants to merge 1 commit intobashclub:mainfrom
ane-energy:fix/openvpn-client-handling
Open

Fix OpenVPN client traffic and maxclients calculation#71
smeinecke wants to merge 1 commit intobashclub:mainfrom
ane-energy:fix/openvpn-client-handling

Conversation

@smeinecke
Copy link

OpenVPN client connections simply fail with:

ipaddress.AddressValueError: Expected 4 octets in 'None'
Traceback (most recent call last):
  File "/usr/local/etc/rc.syshook.d/start/99-checkmk_agent", line 325, in do_checks
    _lines += getattr(self,_check)()
              ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/etc/rc.syshook.d/start/99-checkmk_agent", line 948, in checklocal_openvpn
    _max_clients = ipaddress.IPv4Network(_server.get("tunnel_network")).num_addresses -2
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ipaddress.py", line 1539, in __init__
    self.network_address = IPv4Address(addr)
                           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ipaddress.py", line 1319, in __init__
    self._ip = self._ip_int_from_string(addr_str)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ipaddress.py", line 1206, in _ip_int_from_string
    raise AddressValueError("Expected 4 octets in %r" % ip_str)

Client-mode should be handled in same way as "p2p connections".

  • Treat OpenVPN client entries as p2p for traffic retrieval
  • Guard maxclients derivation behind tunnel_network presence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant