• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Problems adding custom process in Watchdog module

JavierCB

New Pleskian
Hi,

I managed to add a custom process to the list of managed processes by the Watchdog module. To achieve this, I did the following:

- Hardcoded a line with the information of the process in the /opt/psa/etc/modules/watchdog/watchdog_db.sql file:

INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('my-process', 'OpenERP PyC', 130, '/etc/init.d/my-process start', '/etc/init.d/my-process stop');


- Created a file in /opt/psa/etc/modules/service.tpl.d with the following contents:

check process my-process
with pidfile "/var/run/my-process.pid"
start = "/etc/init.d/my-process start"
stop = "/etc/init.d/my-process stop"



- After deactivating and activating the module Watchdog, the new service appeared in the list of processes and it has been working perfectly for months.


The thing is that after one of the latest automatic updates, It has stopped working and the list of processes in Watchdog doesn't show my process anymore.

Does anyone know how to solve this or how to add the process to Watchdog using any other method?

Thanks in advance.
Javier
 
Do you still have a that process record in the module_watchdog_service table?
 
Dear Abdi,

Thank you for your response.

Yes, the record is still there, it was the first thing I checked once I noticed it wasn`t working.

Regards,
Javier
 
Code:
INSERT INTO `psa`.`module_watchdog_service` (`id`, `name`, `label`, `sort_val`, `mon_status`, `save_stats`, `timeout`, `timeout_restart_num`, `timeout_cycles_num`, `connection_timeout`, `start_cmd`, `stop_cmd`, `start_time`) VALUES (NULL, 'g7cp', 'G7CP Server (Abdi)', '20', 'monitored', 'on', 'on', '5', '5', '5', '/etc/init.d/abdi --start', '/etc/init.d/ --stop', '60');

The above just added a record and I was able to see it via extensions -> watchdog ...
 
No luck,

I've entered both the exact same line you put and my register with the format you have provided. After disabling and re-enabling the service, I have updated the service list but I still can't see any of the services in extensions->watchdog. :(

It seems it is not properly getting the information from this file. My Parallels Plesk version is 11.0.9.

Thank you very much for your time.

Javier
 
Javier, I would really love to help you with this, but unfortunately i do not have a testing environment for 11.0.9. I am currently using 11.5.* which is most recent version ..
Am not sure if that difference makes the whole difference but perhaps it's so ...(though I highly doubt this). Perhaps someone here especially from the dev team can advice you accordingly!
 
Thank you very much for your help Abdi.
I also doubt my problem is due to the version I am currently using. I have tried to reconfigure everything after an minor update of parallels 11.0.9, but the problem continues.

Just in case someone is able to find any error, this is the exact content of my configuration files:

watchdog_db.sql:

-- Inserting services.

INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('plesk_apache', 'Plesk Web Server', 10, '/etc/init.d/sw-cp-server start', '/etc/init.d/sw-cp-server stop');
INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('apache', 'Web Server (Apache)', 20, '/opt/psa/admin/bin/websrvmng --start', '/opt/psa/admin/bin/websrvmng --stop');
INSERT INTO module_watchdog_service (name, label, sort_val, connection_timeout, start_cmd, stop_cmd) VALUES ('qmail', 'SMTP Server (Qmail)', 30, 60, '/opt/psa/admin/bin/mailmng --start-qmail-send', '/opt/psa/admin/bin/mailmng --stop-qmail-send');
INSERT INTO module_watchdog_service (name, label, sort_val, connection_timeout, start_cmd, stop_cmd) VALUES ('postfix', 'SMTP Server (Postfix)', 30, 60, '/opt/psa/admin/bin/mailmng --start-service --mail-component=mta', '/opt/psa/admin/bin/mailmng --stop-service --mail-component=mta');
INSERT INTO module_watchdog_service (name, label, sort_val, connection_timeout, start_cmd, stop_cmd) VALUES ('courier_imap', 'IMAP/POP3 Server (Courier-IMAP)', 40, 60, '/opt/psa/admin/bin/mailmng --start-maild', '/opt/psa/admin/bin/mailmng --stop-maild');
INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('bind', 'DNS Server (BIND)', 50, '/opt/psa/admin/bin/dnsmng --start', '/opt/psa/admin/bin/dnsmng --stop');
INSERT INTO module_watchdog_service (name, label, sort_val, start_time, start_cmd, stop_cmd) VALUES ('tomcat', 'Tomcat', 60, 300, '/opt/psa/admin/bin/tomcatmng --start', '/opt/psa/admin/bin/tomcatmng --stop');
INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('coldfusion', 'ColdFusion', 70, '/opt/psa/admin/bin/cfmng --start', '/opt/psa/admin/bin/cfmng --stop');
INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('postgresql', 'PostgreSQL', 90, '/opt/psa/admin/bin/pg_manage --start', '/opt/psa/admin/bin/pg_manage --stop');
INSERT INTO module_watchdog_service (name, label, sort_val, start_time, connection_timeout, start_cmd, stop_cmd) VALUES ('psa_spamassassin', 'Plesk SpamAssassin', 100, 120, 180, '/opt/psa/admin/bin/spamd --start', '/opt/psa/admin/bin/spamd --stop');
INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('drweb', 'Parallels Premium Antivirus', 110, '/opt/psa/admin/bin/drwebmng --start', '/opt/psa/admin/bin/drwebmng --stop');
INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('kavehost', 'Kaspersky Antivirus', 120, '/opt/psa/admin/bin/kavmng start', '/opt/psa/admin/bin/kavmng stop');
INSERT INTO module_watchdog_service (name, label, sort_val, connection_timeout, start_cmd, stop_cmd) VALUES ('pc_remote', 'Plesk Postfix milter filter', 130, 60, '/opt/psa/admin/bin/mailmng --start-service --mail-component=milter', '/opt/psa/admin/bin/mailmng --stop-service --mail-component=milter');
INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('nginx', 'Web Proxy Server (Nginx)', 130, '/opt/psa/admin/bin/nginx_control --start', '/opt/psa/admin/bin/nginx_control --stop');
INSERT INTO module_watchdog_service (name, label, sort_val, start_cmd, stop_cmd) VALUES ('openerp-server-pyc', 'OpenERP PyC', 10, '/etc/init.d/openerp-server-pyc start', '/etc/init.d/openerp-server-pyc stop');


service.tpl.d/openerp-server-pyc:

# OpenERP
check process openerp-server-pyc
with pidfile "/var/run/openerp-server-pyc.pid"
start = "/etc/init.d/openerp-server-pyc start"
stop = "/etc/init.d/openerp-server-pyc stop"


The resulting list is as follows (as it can be seen, the custom service is not shown in the list):

parallels.png

This configuration has been working without any problem until one of the last updates.

Thanks again for your time and help.
Javier
 
Last edited:
Back
Top