php-fpm 的监控配置

标签 monit php

我正在努力寻找适用于 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/

相关文章:

ubuntu - 如何在monit配置文件中转义双引号?

bash - Monit 无法启动进程

web-services - 任何监控 IIS 和应用程序性能的工具

ubuntu - Tomcat:/etc/init.d/tomcat 不存在并且 monit 不工作

php - 在一次查询中支付多张发票

php - 减少在 php 中解析大型 xml 文件的处理时间

php - 定制 Zend_Form

linux - Monit - 停止接收关于 monit reload 的邮件

PHP 安装 : Error: It is not possible to switch enabled streams of a module

php - 填充的下拉列表如何获取值?