centos에 rpm으로 설치했을때는 잘작동하지 않았는데, 이번에는 작동할지?
yum install flex bison openssl-devel
wget http://mmonit.com/monit/dist/monit-5.0.3.tar.gz
tar xvfz monit-5.0.3.tar.gz
cd monit-5.0.3
./configure
make; make install
설정 파일은 다음과 같이(/etc/monitrc)
set daemon 60
set logfile syslog facility LOG_daemon
set mailserver localhost
set alert admin@abc.com
set httpd port 8080 address localhost
allow localhost
check process apache with pidfile "/var/run/httpd.pid"
start = "/etc/init.d/httpd start"
stop = "/etc/init.d/httpd stop"
if failed host 127.0.0.1 port 80 and protocol http
and request "/abc.txt" then restart
if cpu usage is greater than 60 percent for 2 cycles then alert
if cpu usage > 98% for 5 cycles then restart
if 2 restarts within 3 cycles then timeout
alert admin@abc.com
check process mysql with pidfile "/var/run/mysqld/mysqld.pid"
group database
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 usage > 98% for 5 cycles then restart
if 5 restarts within 5 cycles then timeoutinitscript는 다음을 다운받아서
가끔씩 httpd pid를 먹어버리거나...(httpd 자체 문제인지 모르겠음) 문제가 약간 있는듯 하다
http://mmonit.com/ m/monit를 써보고 싶지만 싶지만, 너무 비싸다. (스텐다드 타입이 €99...15만원선..프로페셔널 타입은 €499...76만원선 ㅎㄷㄷ )
Posted by 엽기민원


monit
