On 03/26/2012 01:27 PM, Martin Pala wrote:
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<--


Hi,

These are interesting strategies, as I have some similar requirement.

For my boxes which are yum based often I see a hung updates yum process that is a few days old, so I am looking for something to go and get those, as they cause a miss on the next run of yum in cron.

However the outputs of "ps -ef" and "ps aux" are not entirelely trivial to parse, as the "STIME" field seems to rollover from a "00:00" bare time of day, to a "MMMDD" format after 24 hours...

Cheers,
Tom

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to