Содержание: The correct operation of Plesk depends on a number of services, such as web, database, and mail servers running smoothly. When any of them fail, Plesk and/or hosted websites are affected.

In Plesk for Linux, to keep those services up and running, you can use the free Watchdog extension, which uses the Monit utility. The extension monitors the Plesk services, automatically restarts them if they fail, and notifies you about any services failing via email.

In this topic, you will learn how to enable monitoring for all services, how to configure the monitoring settings for a specific service, and also how to disable monitoring for a specific service.

Предварительные требования

To monitor the Plesk services, the Watchdog extension must be installed from the Extensions Catalog.

Общие сведения об обновлениях

Monitoring can be enabled for some or all Plesk services.

image process statuses

If monitoring of services and disks is enabled, Watchdog checks the status of (or «polls») every service it is configured to monitor at regular intervals (the default polling rate is once every five minutes). For every service that is installed and is being monitored, you can see the service’s status, such as «Running» or «Stopped», in the «Status» column. For services that are either not installed or are not currently being monitored, «Not monitored» is shown.

If Watchdog discovers that any of the services being monitored are down, it takes the following actions automatically:

  • Sends an email notification to the configured email address (by default, it is the email address of the Plesk administrator).
  • Attempts to restart the server.

This way, the administrator is made aware that one or more services went down unexpectedly, which may indicate issues with configuration or available resources, such as free disk space, CPU, or RAM. Additionally, the service is brought back online to minimize the impact on Plesk and/or hosted websites.

If Watchdog discovers that any of the services being monitored are down on a regular basis (by default, if the service is down during each of any five consecutive polls), it takes the following actions automatically:

  • Sends an email notification to the configured email address (by default, it is the email address of the Plesk administrator).
  • Stops monitoring the service.

This way, the administrator is made aware that there are serious issues with one or more services that prevent them from working properly, and that those services need urgent attention.

Enabling Service Monitoring

To start monitoring Plesk services, monitoring of services and disks must be enabled first.

To enable monitoring of services and disks:

  1. Войдите в Plesk.
  2. In the navigation pane, click Extensions, and then go to the «My Extensions» tab.
  3. Locate the Watchdog extension, and then click Open.
  4. Click the «Monitoring of services and disks» toggle button so that it shows «Enabled».

Plesk services are now being monitored.

Примечание: Enabling Plesk services“ monitoring will also enable disk space usage monitoring. One cannot be enabled or disabled without the other.

Configuring Monitoring Settings for Individual Services

For every service being monitored, you can change a number of settings governing the way the service is being monitored. The default values should be fine under most circumstances, and we do not recommend changing them unless you are sure that doing so is necessary.

To configure monitoring settings for a specific service:

  1. Войдите в Plesk.

  2. In the navigation pane, click Extensions, and then go to the «My Extensions» tab.

  3. Locate the Watchdog extension, and then click Open.

  4. Locate the desired service in the list and click its name under «Service».

  5. (Optional) If you want Watchdog to stop monitoring the service after fewer failures, decrease the «times» and/or the «polls» values.

    Примечание: For example, setting the values to «3 times out of 5 polls» will make Watchdog stop monitoring the service if it finds that the service is down during three out of five consecutive polls. Setting the values to «1 times out of 1 polls» will make Watchdog stop monitoring the service the first time it finds that the service is down.

  6. (Optional) If you want Watchdog to keep monitoring the service even if it keeps failing regularly, clear the «Stop monitoring the service if it frequently restarts» checkbox.

  7. (Optional) If a service regularly experiences high load, it may not respond to a Watchdog poll in time. In this case, Watchdog will consider the service to be down and restart it unnecessarily. To avoid this, increase the «Connection timeout» value.

  8. (Optional) If you customize the service startup script, make sure that it finishes within the amount of time specified by the «Service startup time» value. If the custom script runs longer than that, adjust the value accordingly. If the script fails to finish running within the specified amount of time, Watchdog will terminate it, and the service will not be restarted.

  9. Once you have finished configuring the settings, click Save.

The changes you made will take effect the next time Watchdog polls the service.

Disabling Monitoring for Individual Services

If you do not want Watchdog to monitor a specific service, monitoring for that service can be disabled.

To disable monitoring for a specific service:

  1. Войдите в Plesk.
  2. In the navigation pane, click Extensions, and then go to the «My Extensions» tab.
  3. Locate the Watchdog extension, and then click Open.
  4. Locate the desired service in the list.
  5. For that service, under «Monitoring», click «Enabled», and then click «Disable».

The service will no longer be monitored. You can re-enable monitoring for that service by clicking «Disabled», and then clicking «Enable».

Примечание: Stopping a service on the «Services Management» page also disables monitoring for that service if monitoring was enabled.