—————nginx php mysql redis mongodb 配置 完美OK——————–
# nginx
check process nginx withpidfile /usr/local/nginx/logs/nginx.pid
start program = “/usr/local/nginx/sbin/nginx”
stop program = “/usr/bin/killall nginx”
iffailed host 127.0.0.1 port 80 then restart
ifcpu is greater than 40%for2 cycles then alert
ifcpu > 60%for5 cycles then restart
if10 restarts within 10 cycles then timeout
# php5-fpm
check process php-fpm withpidfile /var/run/php-fpm.pid
start program = “/usr/local/php5.3/sbin/php-fpm”
stop program = “/usr/bin/killall php-fpm”
iffailed port 9000 then restart
ifcpu is greater than 40%for2 cycles then alert
ifcpu > 60%for5 cycles then restart
if10 restarts within 10 cycles then timeout# php5-fpm binary.
check file php5-fpm-tcp_bin withpath /usr/local/php5.3/sbin/php-fpm
if10 restarts within 10 cycles then timeout
iffailed checksum then unmonitor
iffailed permission 755 then unmonitor
iffailed uid root then unmonitor
iffailed gid root then unmonitor
alert root@localhost# Test the init scripts.
check file php5-fpm-tcp_init withpath /usr/local/php5.3/sbin/php-fpm
iffailed checksum then unmonitor
iffailed permission 755 then unmonitor
iffailed uid root then unmonitor
iffailed gid root then unmonitor
alert root@localhost
# mysql
c