root/trunk/examples/monitrc

Revision 224, 2.1 kB (checked in by zedshaw, 4 years ago)

A couple of samples related to documentation on the site.

Line 
1 set daemon  60
2 set logfile syslog facility log_daemon
3 set mailserver localhost
4 set mail-format { from: monit@localhost }
5 set alert root@localhost
6
7 check process sshd with pidfile /var/run/sshd.pid
8    start program  "/etc/init.d/ssh start"
9    stop program  "/etc/init.d/ssh stop"
10    if failed port 22 protocol ssh then restart
11    if 5 restarts within 5 cycles then timeout
12
13 check process mysql with pidfile /var/run/mysqld/mysqld.pid
14    group database
15    start program = "/etc/init.d/mysql start"
16    stop program = "/etc/init.d/mysql stop"
17    if failed host 127.0.0.1 port 3306 then restart
18    if 5 restarts within 5 cycles then timeout
19
20 check process httpd with pidfile /usr/local/apache2/logs/httpd.pid
21    group www-data
22    start program  "/usr/local/apache2/bin/apachectl start"
23    stop program  "/usr/local/apache2/bin/apachectl stop"
24    if failed host localhost port 80 protocol http
25       and request "/" then alert
26    if cpu is greater than 60% for 2 cycles then alert
27    if cpu > 80% for 5 cycles then restart
28    if children > 250 then restart
29    if loadavg(5min) greater than 10 for 8 cycles then alert
30    if 3 restarts within 5 cycles then timeout
31
32 check process mongrel_8000 with pidfile /var/rails/MYAPP/log/mongrel.8000.pid
33    group root
34    if failed host 127.0.0.1 port 8000 protocol http
35       and request "/" then alert
36    if cpu is greater than 60% for 2 cycles then alert
37    if cpu > 80% for 5 cycles then restart
38    if loadavg(5min) greater than 10 for 8 cycles then restart
39    if 3 restarts within 5 cycles then timeout
40
41 check process mongrel_8001 with pidfile /var/rails/MYAPP/log/mongrel.8001.pid
42    group root
43    if failed host 127.0.0.1 port 8001 protocol http
44       and request "/" then alert
45    if cpu is greater than 60% for 2 cycles then alert
46    if cpu > 80% for 5 cycles then alert
47    if loadavg(5min) greater than 10 for 8 cycles then alert
48    if 3 restarts within 5 cycles then timeout
49
50 check process postfix with pidfile /var/spool/postfix/pid/master.pid
51    group mail
52    start program = "/etc/init.d/postfix start"
53    stop  program = "/etc/init.d/postfix stop"
54    if failed port 25 protocol smtp then restart
55    if 5 restarts within 5 cycles then timeout
56
57
Note: See TracBrowser for help on using the browser.