monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Monit and VPNC


From: Patrick Baldwin
Subject: Monit and VPNC
Date: Wed, 6 May 2020 13:45:07 -0400

Hi, I'm experimenting with using VPNC to make a VPN connection to a client network via their Cisco router:  https://linux.die.net/man/8/vpnc

It needs to be at least somewhat reliable, so I'd like to manage it with Monit, but I'm having some challenges with getting it going.  It will start and successfully establish the VPN tunnel when I start it manually, but so far I can't get it to start via Monit.

Here's what I see on the Monit webmin:

Process status

ParameterValue
Namevpnc
Pid file/var/run/vpnc.pid
StatusExecution failed | Does not exist
Monitoring statusMonitored
Monitoring modeactive
On rebootstart
Start program'/home/myers/vpnc-wrapper' timeout 30 s
Stop program'/home/myers/vpnc-wrapper' timeout 30 s
Data collectedWed, 06 May 2020 13:42:11
ExistenceIf doesn't exist then restart


I verified the full path to VPNC:

12$ which vpnc

/usr/sbin/vpnc


Since VPNC doesn't make a pidfile, I created a wrapper script:

-rw-rw-rw-. 1 root  root  246 May  5 18:54 vpnc-wrapper

41$ cat vpnc-wrapper

#!/bin/bash


 case $1 in

    start)

       echo $$ > /var/run/vpnc.pid;

       exec 2>&1 /usr/sbin/vpnc 1>/tmp/vpnc.out

       ;;

     stop)

       kill `cat /var/run/vpnc.pid` ;;

     *)

       echo "usage: vpnc {start|stop}" ;;

 esac

 exit 0



And this is how I'm invoking it from my /etc/monitrc:

check process vpnc with pidfile /var/run/vpnc.pid

       start = "/home/myers/vpnc-wrapper"

       stop = "/home/myers/vpnc-wrapper"



Anyone have any thoughts for where I might be going wrong here?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]