OPNsense Forum

English Forums => Virtual private networks => Topic started by: opn_minded on October 09, 2024, 09:16:45 AM

Title: WireGuard -> Tunnel status information for automatic restart by monit
Post by: opn_minded on October 09, 2024, 09:16:45 AM
Hi there,

can someone please tell me how to get the WG tunnel status information (online/offline as shown in the dashboard widget) into monit for further action?

Background: I want monit, if a tunnel goes from online to offline, to restart that tunnel. Monit is already set up, the defined (execute) are tested and should work.
Title: Re: WireGuard -> Tunnel status information for automatic restart by monit
Post by: Monju0525 on October 12, 2024, 02:34:12 PM
How did u setup the WG monitor? I used this link
https://forum.opnsense.org/index.php?topic=35919.0
Title: Re: WireGuard -> Tunnel status information for automatic restart by monit
Post by: opn_minded on October 13, 2024, 12:15:41 PM
i've came up with pings initially, following https://forum.opnsense.org/index.php?topic=38485.0. but, tbh, i thought there should be a more "straight-forward" approach as the tunnel status information is already available in a system widget (as mention below; online/offline).

so that's why i was asking how to get this (.. already available) tunnel status information into monit to tell it "if tunnel wg1 status changes from online to offline -> restart wg1".

thanks for your answer, i've set it up like described in the link below.