Hey Lutz,

The issue I have with checking the app itself is that it forks into many
different children to perform the work so no single app is using all the
CPU. What I want to check for is if the total system usage is BELOW a
certain threshold, restart the parent app.

Thanks,
Mike

On Thu, Feb 18, 2021 at 12:58 PM Lutz Mader <[email protected]> wrote:

> Hello Mike,
> if the application is known you should look to the samples too.
>
> >> But you can check a specific application also, see
> >>
> https://mmonit.com/monit/documentation/monit.html#CONFIGURATION-EXAMPLES
>
> Based on the following sample (from Configuration Samples)
>
> > check process apache with pidfile /var/run/httpd.pid
> >       start program = "/etc/init.d/httpd start"
> >       stop program  = "/etc/init.d/httpd stop"
> >       if cpu > 40% for 2 cycles then alert
> >       if total cpu > 60% for 2 cycles then alert
> >       if total cpu > 80% for 5 cycles then restart
> >       if mem > 100 MB for 5 cycles then stop
>
> you can define resource limits for each service.
>
> With regards,
> Lutz
>
>

Reply via email to