|
From: | Morgan Thunder |
Subject: | Re: Apache rules |
Date: | Wed, 10 Jul 2013 17:49:25 +0200 |
Hi,the Apache usually uses the pre-forked model - the "cpu" test checks the CPU of the target process itself, not the process+children. The parent apache process CPU usage is usually very low, as the real work is handled by children.The "totalcpu" instead of "cpu" test should solve the problem:if totalcpu > 30% for 2 cycles then restartRegards,MartinOn Jul 10, 2013, at 10:33 AM, Morgan Thunder <address@hidden> wrote:Humm this config is in my monitrc not another file in /conf.dmy monitrc:set daemon 60set logfile /var/log/monit.logset idfile /var/lib/monit/id
set statefile /var/lib/monit/stateset eventqueuebasedir /var/lib/monit/eventsslots 100set mmonit https://admin:address@hidden:8443/collector
set alert address@hiddenset httpd port 2812 andssl enablepemfile /var/certs/monit.pemallow root:pass##SERVICEScheck system debian7testif loadavg (5min) > 15 then restartif memory usage > 80% then alertif swap usage > 25% then alertif cpu usage (user) > 60% for 3 cycles then alertif cpu usage (system) > 60% for 3 cycles then alertif cpu usage (wait) > 20% then alert###Apache2check process apache with pidfile /var/run/apache2.pidgroup wwwstart program = "/etc/init.d/apache2 start"stop program = "/etc/init.d/apache2 stop"if failed port 80 protocol http then restartif cpu is greater than 30% for 1 cycles then alertif cpu > 30% for 2 cycles then restartif totalmem > 250 MB for 3 cycles then restartif children > 200 then restartif loadavg(5min) greater than 10 for 4 cycles then restartif 3 restarts within 5 cycles then timeout###Disk Spacecheck filesystem with path /dev/sda1if space usage > 80% then alertif inode usage > 80% then alert###SSHDcheck process sshd with pidfile /var/run/sshd.pidgroup sshstart program "/etc/init.d/ssh start"stop program "/etc/init.d/ssh stop"#if failed port 22 protocol ssh then restart#if 5 restarts within 5 cycles then timeout###MySQLcheck process mysqld with pidfile /var/run/mysqld/mysqld.pidgroup databasestart program = "/etc/init.d/mysql start"stop program = "/etc/init.d/mysql stop"if failed port 3306 protocol mysql then restartif 5 restarts within 5 cycles then timeout###Exim4check process exim4 with pidfile /var/run/exim4/exim.pidstart program = "/etc/init.d/exim4 start"stop program = "/etc/init.d/exim4 stop"--2013/7/9 Josh Sharpe <address@hidden>
if cpu > 30% for 2 cycles then restartdepends on what 'set daemon' is in your /etc/monit/monitrc
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
[Prev in Thread] | Current Thread | [Next in Thread] |