I plan on enabling Monit on my production server with the below configuration. I'm completely new to Monit and wanted to hear from others on tips or if there were other directives I should consider to bolster my monitoring script based on your experience.
My server is CentOS 5.6.
Thanks!
#httpd----
check process httpd with pidfile /var/run/httpd.pid
group apache
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host 127.0.0.1 port 80
protocol http then restart
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if 5 restarts within 5 cycles then timeout
#mysqld----
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
group mysql
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed host 127.0.0.1 port 3306 then restart
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if 5 restarts within 5 cycles then timeout
#postfix----
check process postfix with pidfile /var/spool/postfix/pid/master.pid
start program = "/etc/init.d/postfix start"
stop program = "/etc/init.d/postfix stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if 5 restarts within 5 cycles then timeout