0

Is there any way to monitor a tinc VPN with a monit network check?

The following check does not see if the vpn connection is actually established (means if there is a connection to one of the vpn servers)

CHECK NETWORK vpn with INTERFACE mynetwork
IF FAILED LINK
THEN RESTART

What I do now is checking for one host in my vpn:

CHECK HOST myhost with ADDRESS 10.8.1.111
    IF FAILED ICMP TYPE ECHO
    THEN restart

Which is fine so far but does not cover the situation that this specific host is down while others are up.

ProfHase85
  • 451
  • 3
  • 6
  • 13

1 Answers1

0

I have same problem, and my solution was this:

cat /etc/monit/conf.d/tinc

# monitor tinc daemon
check process tinc with pidfile /var/run/tinc.net.pid
  group system
  start program = "/usr/sbin/service tinc start"
  stop program  = "/usr/sbin/service tinc stop"
  if failed host 127.0.0.1 port 655 type udp then restart