Question
How to monitor the additional Plesk PHP-FPM services in Watchdog?
Answer
Currently, the Watchdog extension only monitors the OS PHP-FPM service and it is not possible to manage the monitoring for the additional Plesk PHP-FPM services.
Vote and comment on this feature request from our Official Plesk UserVoice channel as top-voted suggestions are likely to be included in future Plesk versions.
As a workaround, enable the Watchdog monitoring for the additional Plesk PHP-FPM services manually:
Workaround
Note: The monitoring configuration will be listed in Plesk GUI but it cannot be managed. Notice that the maximum number of items that are listed in Plesk GUI is 25.
-
Connect to the server via SSH
-
Retrieve the additional Plesk PHP-FPM handlers that are being used:
# plesk db -Ne “SELECT php_handler_id FROM hosting WHERE php = ‘true'” | sort | uniq
plesk-php74-fpm -
Find the PID location for the service:
# grep pid /opt/plesk/php/7.4/etc/php-fpm.conf
pid = /run/plesk-php74-fpm.pid -
Create a Watchdog template file with all the parameters:
Warning: The bold values have to be updated with the respective Plesk PHP-FPM handler name and PID location
# cat /usr/local/psa/etc/modules/watchdog/service.tpl.d/plesk-php74-fpm
check process plesk-php74-fpm
with pidfile /run/plesk-php74-fpm.pid
start = “/usr/local/psa/admin/bin/phpinimng –type fpm –start –service-name plesk-php74-fpm“
stop = “/usr/local/psa/admin/bin/phpinimng –type fpm –stop –service-name plesk-php74-fpm“
if 5 restarts within 5 cycles then timeout
every 1 cycles
mode active -
Back up Plesk database:
# plesk db dump psa > psa.backup.sql
-
Create a record in the
module_watchdog_service
 table:Warning: The bold values have to be updated with the respective Plesk PHP-FPM handler name
# plesk db “INSERT INTO psa.module_watchdog_service (name,label,sort_val,mon_status,start_cmd,stop_cmd) VALUES (‘plesk-php74-fpm‘,’Plesk PHP-FPM 7.4‘, 140, ‘monitored’, ‘/usr/local/psa/admin/bin/phpinimng –type fpm –start –service-name plesk-php74-fpm‘,’/usr/local/psa/admin/bin/phpinimng –type fpm –stop –service-name plesk-php74-fpm‘)”
-
Recreate Watchdog configuration with a full restart to apply the changes:
# /usr/local/psa/admin/bin/modules/watchdog/wd –full-restart
-
Going to Plesk > Extensions > My Extensions > Watchdog, the additional Plesk PHP-FPM service will be listed, but mind that it cannot be disabled or enabled from Plesk GUI:
If it’s required to rollback the changes, run the following comands:
Warning: The bold value is the parameter used in the article
# rm /usr/local/psa/etc/modules/watchdog/service.tpl.d/plesk-php74-fpm
# plesk db “DELETE FROM psa.module_watchdog_service WHERE name = ‘plesk-php74-fpm‘”
# /usr/local/psa/admin/bin/modules/watchdog/wd –full-restart