1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Add new service to WatchDog module

Discussion in 'Plesk for Linux - 8.x and Older' started by Barry Hunter, Jul 30, 2010.

  1. Barry Hunter

    Barry Hunter Guest


    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!
  2. ChK

    ChK Guest

    i have the same question, has anyone a solution or work a round?
  3. Scooby

    Scooby New Pleskian

    Jan 10, 2008
    Likes Received:

    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/
    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: Feb 16, 2011