opnsense_get_vpn_status
Check VPN connectivity by retrieving WireGuard peer and OpenVPN session status, including last handshake times and transfer counters, to see who is connected.
Instructions
Get the status of WireGuard peers and OpenVPN sessions, including last handshake times and transfer counters.
For WireGuard, last handshake is the field that matters: a configured peer with no recent handshake is not connected, no matter what the interface status says. WireGuard is connectionless, so there is no "down" state to observe directly.
Args: params (VpnStatusInput): Validated input containing: - kind (str): "wireguard", "openvpn" or "both" (default: "both") - response_format (ResponseFormat): 'markdown' or 'json'
Returns: str: Markdown sections per VPN type, or JSON with this schema: { "wireguard": [ {"name": str, "interface": str, "endpoint": str, "latest-handshake": str, "transfer-rx": str, "transfer-tx": str, "allowed-ips": str} ], "openvpn": [ {"common_name": str, "real_address": str, "virtual_address": str, "bytes_received": str, "bytes_sent": str, "connected_since": str} ] } A key is omitted when that VPN type is not configured or its endpoint is absent.
Examples: - Use when: "Is my phone connected over WireGuard?" -> kind="wireguard" - Use when: "Who is on the VPN right now?" -> kind="both"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |