概要: The correct operation of Plesk and its services depends on having enough free disk space and unique file identifiers (inodes) on the server. If the server runs out of either, Plesk and/or hosted websites are affected.

In Plesk for Linux, to make sure that you do not run out of either, you can use the free Watchdog extension, which uses the Monit utility. The extension monitors the Plesk server's file system partitions, notifies you about any partitions in danger of running out of free disk space or inodes via email, and can also run a predetermined command when a partition starts running low on either.

In this topic, you will learn how to enable disk space usage monitoring for all partitions, how to configure the monitoring settings for a specific partition, and also how to disable monitoring for a specific partition.

前提条件

To monitor disk space usage, the Watchdog extension must be installed from the Extensions Catalog.

概要

Monitoring can be enabled for some or all partitions on the Plesk server.

image monitored partitions

For every partition being monitored, two thresholds can be configured independently:

  • The disk space usage threshold can be configured as either a percentage of a partition's total disk space or an absolute value in kilobytes, megabytes, or gigabytes. By default, the threshold is set to 80%.
  • The file number threshold can be configured as either a percentage of a partition's total number of inodes or an absolute value (expressed as a non-negative integer). By default, the threshold is set to 80%.

注釈: When configuring absolute values for either threshold, the entered values are not validated. If a value exceeding the partition's total disk space or total number of allowed inodes is entered, the threshold would never be reached or exceeded, and no notification would ever be sent.

If disk space usage monitoring is enabled, Watchdog checks the status of (or "polls") every partition it is configured to monitor at regular intervals (the default polling rate is once every five minutes). If it discovers that any of the configured thresholds for any partition being monitored has been reached or exceeded, one or both of the following actions are taken automatically:

  • By default, an email notification is sent to the specified email address.
  • Additionally, a command can be configured to be run on the server.

This way, you will know in advance that the free disk space and/or the number of available inodes is running low on one or more partitions, and take action to prevent the consequences of completely running out of disk space or inodes. You can also configure Watchdog to automatically run some command or script that will free up more disk space or inodes (you will need to provide such a command or script yourself, no such command or script is shipped with Plesk).

Enabling Disk Space Usage Monitoring

To start monitoring disk space usage, 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. Go to the "Disks" tab, and then click the "Monitoring of services and disks" toggle button so that it shows "Enabled".

Disk space usage is now being monitored for all partitions. For each partition, the disk space and inode usage threshold is set to 80%, and no command is configured to be run once either threshold is reached.

注釈: Enabling disk space usage monitoring will also enable Plesk services' monitoring. One cannot be enabled or disabled without the other.

Configuring Disk Space Usage Monitoring Settings for Individual Partitions

For every partition being monitored, you can change the default values for both the disk space usage and file number thresholds. You can also configure a command or script to be run if either threshold is reached or exceeded.

To configure disk space usage monitoring settings for a specific partition:

  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. Go to the "Disks" tab, and then, under "Device", click the partition whose monitoring settings you want to configure. Only settings for partitions currently being monitored can be configured.

  5. (Optional) Change the values for the disk space usage or file number threshold. To switch between percentages and absolute values, select the desired option from the drop down menu to the right of the field containing the value.

  6. (Optional) Enter the command to be run if either threshold is reached or exceeded in the "Command to execute" field.

    注釈: The command is only run once when a threshold is reached or exceeded, not every time Watchdog polls the partitions. Once the command has been run, the disk space or inode usage for the partition has to return to normal, and then a threshold has to be reached or exceeded again for the command to run for the second time.

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

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

Disabling Disk Space Usage Monitoring Settings for Individual Partitions

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

To disable disk space usage monitoring for a specific partition:

  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. Go to the "Disks" tab and locate the desired partition in the list.
  5. For that partition, under "Monitoring", click "Enabled", and then click "Disable".

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

注釈: Disabling disk space usage monitoring for a partition resets any changes made to its monitoring settings (if any were made). If you re-enable monitoring for such a partition later, you will need to configure its monitoring settings once again.