I tested the “with timeout 30 seconds” by disconnecting the physical network connection on this computer. The openvpn monit check goes haywire. The entire openvpn check ran incessantly; even the process check no longer honored the 5 second timeout. And, the “check network vpn…” with the new timeout value did not seem to help at all. The monit webUI says the start/stop has 30 s timeout, but does not honor it. I have attached the relevant parts of the monit.log.
check process openvpn with pidfile /run/openvpn/protonvpn.pid start program = "/bin/systemctl start openvpn" stop program = "/bin/systemctl stop openvpn" if failed host 184.108.40.206 port 53 type tcp protocol dns retry 5 then stop check network vpn with interface tun0 start program = "/usr/bin/monit start openvpn" with timeout 30 seconds stop program = "/usr/bin/monit stop openvpn" if failed link then restart
See also comments from issue