php-fmp 사이트의 .sock 파일을 추적하도록 monit 설정

php-fmp 사이트의 .sock 파일을 추적하도록 monit 설정

PHP가 충돌할 경우 도메인을 추적할 수 있도록 Monit을 설정하려고 합니다. 예:

check file php7.3-fpm-pidfile with path /var/run/php/php7.3-fpm.pid
    start program = "/usr/sbin/service php7.3-fpm start" with timeout 60 seconds
    stop program  = "/usr/sbin/service php7.3-fpm stop"
    if does not exist then restart
    if failed unixsocket /run/php/php7.3-fpm-domain.co.uk.sock then restart
    if failed unixsocket /run/php/php7.3-fpm-domain2.co.uk.sock then restart
    if failed unixsocket /run/php/php7.3-fpm-domain3.co.uk.sock then restart

간단한 테스트로:

check file php7.3-fpm-pidfile with path /var/run/php/php7.3-fpm.pid
    start program = "/usr/sbin/service php7.3-fpm start" with timeout 60 seconds
    stop program  = "/usr/sbin/service php7.3-fpm stop"
    if does not exist then restart
    if failed unixsocket /run/php/php7.3-fpm-domain.co.uk.sock then restart

그러나 Monit을 다시 시작하면 최종 결과가 실패합니다.

/etc/monit/conf-enabled/php-fpm:14: 구문 오류 'unixsocket'

나는 켜져있다모니터 5.31.0, 옵션이 있을 만큼 충분히 새로운 것이어야 합니다 unixsocket. 내가 무엇을 놓치고 있나요?

답변1

파일을 확인하시겠습니까? 내 관점에서는 프로세스를 확인하시겠습니까?

unixsocket과 프로세스를 확인하라는 제안은 다음과 같습니다.

check process php7.3-fpm-pidfile with path /var/run/php/php7.3-fpm.pid
    start program = "/usr/sbin/service php7.3-fpm start" with timeout 60 seconds
    stop program  = "/usr/sbin/service php7.3-fpm stop"
    if does not exist then restart
    if failed unixsocket /run/php/php7.3-fpm-domain.co.uk.sock then restart

모든 검사에 사용 가능한 모든 테스트("if" 문)를 사용할 수는 없습니다.

monit -v -t
Process Name          = php7.3-fpm-pidfile
 Pid file             = /var/run/php/php7.3-fpm.pid
 Monitoring mode      = active
 On reboot            = start
 Start program        = '/usr/sbin/service php7.3-fpm start' timeout 1 m
 Stop program         = '/usr/sbin/service php7.3-fpm stop' timeout 30 s
 Existence            = if does not exist then restart
 Unix Socket          = if failed /run/php/php7.3-fpm-domain.co.uk.sock type TCP protocol DEFAULT with timeout 5 s then restart

매뉴얼의 일부를 참조하세요.https://www.mmonit.com/monit/documentation/monit.html

연결 테스트

Monit은 네트워크 포트나 Unix 소켓을 통해 연결 테스트를 수행할 수 있습니다. 연결 테스트는 프로세스 또는 호스트 서비스 유형 컨텍스트 내에서만 사용할 수 있습니다.

연결 테스트는 프로세스 또는 호스트 서비스에서만 사용할 수 있습니다.

관련 정보