我正在努力寻找适用于 php-fpm 的监视器配置。
这是我试过的:
### Monitoring php-fpm: the parent process.
check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
group phpcgi # phpcgi group
start program = "/etc/init.d/php-fpm start"
stop program = "/etc/init.d/php-fpm stop"
## Test the UNIX socket. Restart if down.
if failed unixsocket /var/run/php-fpm.sock then restart
## If the restarts attempts fail then alert.
if 3 restarts within 5 cycles then timeout
但是失败了,因为没有php-fpm.sock (Centos 6)
最佳答案
对于在 Centos 6 上遇到此问题的其他人,php-fpm 套接字位于 /var/run/php-fpm/php-fpm.sock
因此最终的配置应该是这样的:
check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
group phpcgi #change accordingly
start program = "/etc/init.d/php-fpm start"
stop program = "/etc/init.d/php-fpm stop"
if failed unixsocket /var/run/php-fpm/php-fpm.sock then restart
if 3 restarts within 5 cycles then timeout
关于php-fpm 的监控配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7846847/