monit-general
[Top][All Lists]
Advanced

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

Re: Only one restart?


From: Martin Pala
Subject: Re: Only one restart?
Date: Tue, 24 Feb 2004 23:01:33 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040122 Debian/1.6-1

Hi,

two hints:

1.) use https instead of http test - you need to add 'type tcpssl' to the rule

2.) it could be better to split connection test and stunnel check:

 check process stunnel4 with pidfile "/var/run/stunnel.pid"
  start program = "/etc/init.d/stunnel4 start"
  stop  program = "/etc/init.d/stunnel4 stop"
  alert address@hidden

 check host stunnel4-target with address 127.0.0.1
  if failed port 81 type tcpssl protocol HTTP then alert
  alert address@hidden
  depends on stunnel4


=> stunnel target service depends on running stunnel process. In the case that stunnel is running but the connection failed, monit will not try to restart stunnel (which makes no sence).


Martin


Alexander Schinner wrote:
Hi,

I am quiete new to monit and now I have a problem, which I can't solve. I have read the manual, the FAQ but can't see the solution. SI here is my problem:

stunnel is forwarding access to localhost:81 to an https server. Now, for some reason it can be that the configuration file is not valid (that's okay, too) and stunnel will not start. So far, so good.

Now, my configuration:

[....]
check process stunnel4
        with pidfile "/var/run/stunnel.pid"
        start program = "/etc/init.d/stunnel4 start"
        stop  program = "/etc/init.d/stunnel4 stop"
        if failed host 127.0.0.1 port 81 protocol HTTP then restart
        alert address@hidden
[....]

Case 1:

Monit can't connect to Port 81anymore , restarts stunnel, stunnels starts up, everything is okay. Perfect....

Case 2:

Monit can't connect to Port 81 anymore, restarts stunnel, stunnels starts but does not allow an connect to Port 81. Now monit does NOT try to connect again.... ? Why?


Syslog said:

Feb 24 09:29:10 devel11 monit[21589]: Event: 'stunnel4' failed, cannot open a connection to INET[127.0.0.1:81]
Feb 24 09:29:10 devel11 monit[21589]: Trying to restart 'stunnel4'
Feb 24 09:29:10 devel11 monit[21589]: stop: (stunnel4) /etc/init.d/stunnel4
Feb 24 09:29:11 devel11 monit[21589]: start: (stunnel4) /etc/init.d/stunnel4

Does monit performs only 1 restart, if a test fails and will wait until the test succeeds?
Thanx,
Alexander






reply via email to

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