• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Is there a way to monitor additional services with psa-watchdog?

Maarten

Golden Pleskian
Plesk Guru
Server operating system version
AlmaLinux 8.6 (Sky Tiger)
Plesk version and microupdate number
Plesk Obsidian Version 18.0.46
Hi,

Is there a way to monitor amavisd or any additional service and restart it when it goes down?
I tried to add an amavisd config file to /usr/local/psa/etc/modules/watchdog/service.d/, but it gets deleted after a while.

Next, I tried to install monit (I know psa-watchdog is based on monit), but that seems to clash with the monit.service:

Error: Transaction test error:
file /usr/lib/systemd/system/monit.service from install of monit-5.30.0-1.el8.x86_64 conflicts with file from package psa-watchdog-18.0-2.redhat.8+p18.0.46.0+t220811.0319.x86_64

It would help if Plesk renamed /usr/lib/systemd/system/monit.service to /usr/lib/systemd/system/psa-watchdog.service
 
I fixed this by manually adding a new service to the PSA database:

Note: I've tested this on an Almalinux 8.6 server.

Make sure you have a backup of the PSA database before you continue:
Code:
# plesk db dump psa > /root/psa_dump.sql

Add the new service to the module_watchdog_service table:
SQL:
INSERT INTO `module_watchdog_service` (name, label, sort_val, connection_timeout, start_cmd, stop_cmd) VALUES
('amavis', 'Amavis email filter', 51, 5, '/bin/systemctl start amavisd.service', '/bin/systemctl stop amavisd.service');

Watchdog needs to know there is a new service available.
These services are defined in /usr/local/psa/etc/modules/watchdog/monitrc.tpl, so let's make a copy before we change it:
Code:
# cp /usr/local/psa/etc/modules/watchdog/monitrc.tpl /usr/local/psa/etc/modules/watchdog/monitrc.tpl.bak

Add the following code to the end of the file /usr/local/psa/etc/modules/watchdog/monitrc.tpl
Code:
# Amavis
check process amavis
    with pidfile "/var/run/amavisd/amavisd.pid"
    start = "<amavis_start>"
    stop = "<amavis_stop>"
    if <amavis_timeout_restarts> restarts within <amavis_timeout_cycles> cycles then timeout
    every <amavis_cycles> cycles
    mode <amavis_mode>

Open the Watchdog extension and stop and start the watchdog service. You should see the new amavis service.
Click on the amavis link and enable the amavis check.

To test if it works, stop the amavis daemon and check the log file until the watchdog starts amavis again.

Code:
# systemctl stop amavisd.service
# tail -f /var/log/plesk/modules/monit.log

Note: I'm unsure if this change will survive a Plesk or a watchdog extension update. Let's wait and see what happens.
 
Back
Top