monit-general
[Top][All Lists]
Advanced

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

Re: Monitor long running processes and kill them


From: Martin Pala
Subject: Re: Monitor long running processes and kill them
Date: Mon, 26 Mar 2012 14:27:44 +0200

Hi,

if the process does have a pidfile, it is usually updated only when the process 
starts - in such case you can use the timestamp test to restart the process, 
for example:
--8<--
check file myprocpid with path /var/run/myproc.pid
   if timestamp > 3 days then exec "/etc/init.d/myproc restart"
--8<--


We can easily implement uptime test to Monit in the future, so it can be 
possible to use somethig like:
--8<--
check process myproc with pidfile /var/run/myproc.pid
   start program = …
   stop program = ...
   if uptime > 3 days then restart
--8<--


Regards,
Martin


On Mar 16, 2012, at 10:46 PM, Christian Becker wrote:

> Hi There,
> 
> is it possible with monit to check how long a process is running and kill 
> them, if it exceeds the prefered time.
> 
> Kind regards
> Chris
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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