monit-general
[Top][All Lists]
Advanced

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

[monit] Monitoring ssh tunnel


From: Stephen Nelson-Smith
Subject: [monit] Monitoring ssh tunnel
Date: Mon, 7 Dec 2009 12:49:28 +0000

I want to use monit to keep an ssh tunnel up.

I ssh from inside a broadband network to an external server, so I can
then ssh back down the tunnel.  However, I wish to keep that
connection up.

I'm setting up the tunnel with the following arguments:

PORT_FWD="-R 127.0.0.1:40022:127.0.0.1:22 -L 127.0.0.1:40001:127.0.0.1:40001 -N"
My first try was to try an http get down the tunnel from the broadband
machine (and make it available down the tunnel), but this doesn't seem
to return a 200 - perhaps because I'm using virtual hosts, so monit
restarts itself regularly.

I then tried just running netcat on a high port on the external
machine (40001 as above), and testing for that, but if I kill netcat,
monit doesn't seem to notice, and doesn't restart.

Here's my config;

check process atalanta-tunnel with pidfile /var/run/atalanta-tunnel.pid
    start program  = "/etc/init.d/atalanta-tunnel start"
    stop program  = "/etc/init.d/atalanta-tunnel stop"
# For use on remote systems
    if failed host 127.0.0.1 port 40001
       then restart

What am I missing?  How should I go about achieving this?

S.

-- 
Stephen Nelson-Smith
Technical Director
Atalanta Systems Ltd
www.atalanta-systems.com




reply via email to

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