Watchdog extension monitors only PHP-FPM application provided by OS vendor only

Created:

2017-07-12 14:14:39 UTC

Modified:

2017-08-16 16:08:21 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Watchdog extension monitors only PHP-FPM application provided by OS vendor only

Applicable to:

  • Plesk for Linux

Question

Watchdog extension monitors only PHP-FPM application provided by OS vendor only. It is possible to add additional PHP-FPM handlers?

Answer

Watchdog extension has predefined set of services to track and only PHP-FPM by OS vendor is available. Currently, there is no functionality in this extension to add additional services or PHP-FPM handlers. You can suggest such improvement on our UserVoice resource:

https://plesk.uservoice.com/forums/184549-feature-suggestions

However, the extension can be customized to track one of the additional PHP-FPM services shipped with Plesk instead of the default one:

How to customize Watchdog extension to track PHP-FPM 5.6

  1. Install Watchdog extension via Plesk installer
  2. Create a backup and change path to the PID file in php-fpm section in the following files:

    # /usr/local/psa/etc/modules/watchdog/monitrc.tpl
    
    # /usr/local/psa/etc/modules/watchdog/monitrc_vz.tpl

    find PID file location for the service:

    # grep pid /opt/plesk/php/5.6/etc/php-fpm.conf
    
    pid = /var/run/plesk-php56-fpm.pid

    the php-fpm section in these files should be modified as below

    # php-fpm
    
    check process php_fpm
    with pidfile /var/run/plesk-php56-fpm.pid < ------- change path to PID file
    start = "<php_fpm_start>"
    stop = "<php_fpm_stop>"
    if <php_fpm_timeout_restarts> restarts within <php_fpm_timeout_cycles> cycles then timeout
    every <php_fpm_cycles> cycles
    mode <php_fpm_mode>
  3. Update start/stop actions in PSA database, create a backup first:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin psa > /root/psa`date +%F_%H.%M`.sql
    
    # plesk db
    mysql> update psa.module_watchdog_service set start_cmd='/usr/local/psa/admin/bin/phpinimng --type fpm --service-name plesk-php56-fpm --start', stop_cmd='/usr/local/psa/admin/bin/phpinimng --type fpm --service-name plesk-php56-fpm --stop' where name = 'php_fpm';
    mysql> select * from module_watchdog_service where name = 'php_fpm'\G
    *************************** 1. row ***************************
    id: 15
    name: php_fpm
    label: PHP-FPM (FastCGI Process Manager)
    sort_val: 140
    mon_status: monitored
    save_stats: on
    timeout: on
    timeout_restart_num: 5
    timeout_cycles_num: 5
    connection_timeout: 5
    start_cmd: /usr/local/psa/admin/bin/phpinimng --type fpm --service-name plesk-php56-fpm --start
    stop_cmd: /usr/local/psa/admin/bin/phpinimng --type fpm --service-name plesk-php56-fpm --stop
    start_time: 60
    1 row in set (0.00 sec)
  4. After that disable/enable watchdog in Plesk UI

Have more questions? Submit a request
Please sign in to leave a comment.