• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Add new service to WatchDog module

B

Barry Hunter

Guest
Hi,

We've installed SphinxSearch ( http://www.sphinxsearch.com/ ) on our server, it works great.

I'm now trying to get the WatchDog module (ala monit) to maintain it.


Plesk doesn't seem to include a way to define new services, so (probably not recommended) I inserted a new row in the psa.module_watchdog_service table.

This how shows in the list of serves on the Watchdog page, but its inactive because "Service monitoring is turned off because it shuts down frequently"

- I think the reason is havent told it how to check its alive. Looking at the monit config file, it mostly uses a pidfile to identify if the service is alive. Alas I can't find an option to tell it where the pid file is for the searchd deamon.

(I've called the monitor 'searchd' which matches the name of the sphinx deamon, in case it could simply look at the processlist)

Alas nothing for searchd is added to the monit config file.

Any ideas? Thanks!
 
i have the same question, has anyone a solution or work a round?
 
Hi,

Figured this out just a minute ago, it wasn't too hard.

After adding the row in the psa database, you also have to add a file in the service template directory at /opt/psa/etc/modules/watchdog/service.tpl.d (or wherever the psa dir is on your distribution)

Here is what I used for monitoring clamd. Using what's in the monitrc file as an example, I just typed this in a file named 'clamd' which I then dropped in service.tpl.d/
Code:
check process clamd
        with pidfile "/var/run/clamav/clamd.pid"
        start = "/etc/init.d/clamav-daemon start"
        stop = "/etc/init.d/clamav-daemon stop"
        if failed host localhost port 3310 type tcp with timeout 30 seconds then restart
        every 1 cycles
        mode active

Then disabling-enabling the Watchdog in Plesk will activate it by copying your file in the service template directory to the live directory. Don't mess with the files in service/ or the monitrc files, just drop your customizations in service.tpl.d/ and make sure that the 'check process <name>' matches the name you put in the name field of your newly added row in the psa.module_watchdog_service table
 
Last edited:
Back
Top