Line 123: <td><?=$client['remote_host'];?><br/><?=$client['virtual_addr'];?></td>Should be : <td><?=$client['remote_host'];?><br/><?=$client['virtual_address'];?></td>
root@opnsense_redacted_host:~ # echo state | socat - unix-connect:/var/etc/openvpn/clientX.sock>INFO:OpenVPN Management Interface Version 3 -- type 'help' for more info1680171329,CONNECTED,SUCCESS,<VIP redacted>,<Server IP Redacted>,<Redacted Server (Destination) Port>,<I/F IP Redacted>,<Redacted Source Port>END
root@opnsense_redacted_host:~ # echo status 3 | socat - unix-connect:/var/etc/openvpn/clientX.sock>INFO:OpenVPN Management Interface Version 3 -- type 'help' for more infoOpenVPN STATISTICSUpdated,2023-03-31 03:08:03TUN/TAP read bytes,707211TUN/TAP write bytes,954184TCP/UDP read bytes,1151666TCP/UDP write bytes,898354Auth read bytes,955224pre-compress bytes,0post-compress bytes,0pre-decompress bytes,0post-decompress bytes,0END
COMMAND -- status-----------------Show current daemon status information, in the same format asthat produced by the OpenVPN --status directive.Command examples:status -- Show status information using the default status format version.status 3 -- Show status information using the format of --status-version 3.
--status args Write operational status to file every n seconds.Valid syntaxes:status filestatus file nStatus can also be written to the syslog by sending a SIGUSR2 signal.With multi-client capability enabled on a server, the status file includes a list of clients and a routing table. The output format can be controlled by the --status-version option in that case.For clients or instances running in point-to-point mode, it will contain the traffic statistics.--status-version nSet the status file format version number to n.This only affects the status file on servers with multi-client capability enabled. Valid status version values:1 -- Traditional format (default). The client list contains the following fields comma-separated: Common Name, Real Address, Bytes Received, Bytes Sent, Connected Since.2 -- A more reliable format for external processing. Compared to version 1, the client list contains some additional fields: Virtual Address, Virtual IPv6 Address, Username, Client ID, Peer ID, Data Channel Cipher. Future versions may extend the number of fields.3 -- Identical to 2, but fields are tab-separated.
One option might be to re-write the script to parse:The clientX.conf file for the "CN";The output of state for "Real Address"; &The output of status for "Bytes Sent" & "Bytes Received".
opnsense-patch a5c4de0opnsense-patch 3066c87