monit-general
[Top][All Lists]
Advanced

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

RE: monit watchdog timer restart


From: Peter Holdaway
Subject: RE: monit watchdog timer restart
Date: Tue, 24 Feb 2004 14:36:52 -0800

I have tried this and the stop action does not affect the process.

monit.log says...

[ Feb 24 14:32:18] start: (AppManager) /opt/lxs/bin/lxs.sh
[ Feb 24 14:34:37] Event: timestamp test failed for
/var/lxs/run/AppManager.monit


monit status says...

Process 'AppManager'                running
File 'AppManager_monit'             not monitored


Is this a bug?

Regards,

  Peter

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden
> On Behalf Of Martin Pala
> Sent: Tuesday, 24 February 2004 2:12 PM
> To: This is the general mailing list for monit
> Subject: Re: monit watchdog timer restart
> 
> Hi, following setup should work in this case:
> 
>   check process AppManager with pidfile "/var/lxs/run/AppManager.pid"
>    start program = "/opt/lxs/bin/lxs.sh start AppManager"
>    stop program = "/opt/lxs/bin/lxs.sh stop AppManager"
> 
>   check file AppManager_monit with path "/var/lxs/run/AppManager.monit"
>    if timestamp > 2 minutes then stop
>    depends on AppManager
> 
> 
> Stop events are inherited via dependency, though the depending file-type
> service has no stop method defined.
> 
> 
> Martin
> 
> Peter Holdaway wrote:
> > Hi,
> >
> >   I would like some advice on the simplest way to implement a watchdog
> timer
> > restart of a process. Perhaps this could also be added to the
> documentation
> > too.
> >
> >   I have a process that should be regularly updating a file. If it is
> not I
> > can assume the process is broken and should be restarted. In the absence
> of
> > a network protocol, this is often the easiest way to instrument a
> process
> > for monitoring its readiness to perform work.
> >
> >
> >   In version 3.2 of monit this was accomplished by...
> >
> > check AppManager with pidfile /var/lxs/run/AppManager.pid
> >     start program = "/opt/lxs/bin/lxs.sh start AppManager"
> >     stop program = "/opt/lxs/bin/lxs.sh stop AppManager"
> >     if timestamp "/var/lxs/run/AppManager.monit" > 2 minute then restart
> >
> >
> >   Is the following the best expression of this problem in monit 4.2 ?
> >
> >
> > check process AppManager with pidfile "/var/lxs/run/AppManager.pid"
> >     start program = "/opt/lxs/bin/lxs.sh start AppManager"
> >     stop program = "/opt/lxs/bin/lxs.sh stop AppManager"
> >
> > check file AppManager_monit with path "/var/lxs/run/AppManager.monit"
> >     if timestamp > 2 minutes then exec "/opt/lxs/bin/lxs.sh stop
> AppManager"
> >     depends on AppManager
> >
> >
> > Notice the unusual direction of the dependency. There do not seem to be
> any
> > examples of this in the documentation.
> >
> > This dependency is required so that when "monit stop AppManager" is
> issued
> > then the AppManager_monit service is also stopped.
> >
> > This solution requires two time periods to restart the process, one for
> the
> > timestamp and one for the process restart.
> >
> >
> > TIA
> >
> >   Peter
> >
> >
> >
> > --
> > To unsubscribe:
> > http://mail.nongnu.org/mailman/listinfo/monit-general
> 
> 
> 
> --
> To unsubscribe:
> http://mail.nongnu.org/mailman/listinfo/monit-general





reply via email to

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