[Top][All Lists]

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

Re: problem using check file to exec script if (*manual* mode process) h

From: Alex Stewart
Subject: Re: problem using check file to exec script if (*manual* mode process) has x restarts in y cycles
Date: Thu, 13 Sep 2007 22:23:45 -0400

I have now been able to replicate this issue in both v4.9 & v4.8.1 -
and in both cases monit *exits* (with the error message given in the
email below) which according to the changelog
( was specifically fixed
in v4.8 - "Removed a feature introduced in 4.7 which tested that a
check-file, check-directory or check-fifo actually refered to an
existing object of that type.  Monit should not require these file
objects to exist at startup."

Irrespective of whether the feature was actually removed in all cases
in versions >=4.8, I would have thought that it should have been
removed in the case that the check file statement is 'mode manual' as
it prevents monit from starting

Am I missing something here, or should I file a bug report about this?


On 9/11/07, Alex Stewart <address@hidden> wrote:
> Dear All,
> I want to make monit execute a script if a particular service is
> restarted x times in y cycles, from reading the mailing list, the
> following suggestion using a check on the timestamp on the pid file of
> the process was suggested:
> --8<--
>   check file myprocpid with path /var/run/
>     if changed timestamp 2 times within 5 cycles then exec '...'
> --8<--
> BUT - the problem I'm having with this is that in my case the service
> in question is in mode manual, and hence the pid file does not (and
> should not) exist until monit is asked to start the group which
> contains the process.  The fact that the file is not present when
> monit is started appears to upset the daemon (it exits:  Error: the
> path '/var/run/bfrt-monit/pid-files/' used in the
> TIMESTAMP statement does not exist 'shutdown') even though I have
> 'mode manual' (and 'group testGroup' - which is not started when the
> daemon is started by init) in the check file statement which is:
> check file testMat_pidfile with path /var/run/bfrt-monit/pid-files/
>    if changed timestamp 3 times within 12 cycles then exec
> "/usr/local/bfrt-monit/scripts/nodeControl shutdown"
>    mode manual
>    group testGroup
> I have tried swapping the pid file path for the path to a text file
> that does exist when the daemon starts up, and monit duly starts as
> usual and the web interface indeed shows that testMat_pidfile has a
> status of 'not monitored' (i.e. the desired behaviour) - but I don't
> know how to make it work with the pidfile case.
> Does anyone know what I'm doing wrong? (sorry if the answer is
> trivial, lots of people must have done this, but I haven't been able
> to find a solution)
> -Alex

reply via email to

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