/etc/monit.d/ にコンフィグを作ります。
httpdの監視サンプル
check process httpd with pidfile /var/run/httpd.pid
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed port 80 then alert
if failed port 80 then restart
tomcatの監視サンプル
check process tomcat with pidfile /var/run/tomcat.pid
start program = "/etc/init.d/tomcat start"
stop program = "/etc/init.d/tomcat stop"
if failed port 8005 then restart
if cpu > 70% for 5 cycles then alert
if mem > 70% for 5 cycles then alert