Re: [EXTERNAL] Restart apps based on total system CPU usage
Lutz Mader <[email protected]> Thu, 18 Feb 2021 20:33:52 +0100
| Newsgroups | gmane.comp.monitoring.monit.general |
|---|---|
| Message-ID | <[email protected]> |
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