Markus Michalski FAQ

Watchdog: Disk Space

Monitors the usage of a mount point in percent with warn and fail thresholds. Type disk_space, runner Agent. Fields, defaults, statuses and messages.

Deutsche Version

Back to check types

Watchdog: Disk Space

The check reads total and free space of a path and calculates the usage in percent.

Property Value
Type identifier disk_space
Runner Agent
Target in the email Path

Fields

Field Key Default Meaning
Mount path path / Required. Absolute path of the mount point, for example /, /var or /mnt/backup
Warn threshold (%) warn_percent 80 WARN from this usage
Fail threshold (%) fail_percent 90 FAIL from this usage. Must be greater than the warn threshold

Behaviour

If the environment variable HOST_ROOT is set in the agent, the check prepends it to the path. /var then becomes /host/root/var. Usage is (total - free) / total, rounded to whole percent. It can therefore differ slightly from the Use% column of df.

Situation Status Message
Usage below the warn threshold OK <n>% used (<free> free of <total>)
Usage at or above the warn threshold WARN <n>% used (<free> free of <total>)
Usage at or above the fail threshold FAIL <n>% used (<free> free of <total>)
Path does not exist or is not a directory UNKNOWN Path not found or not a directory: <path>
Fail threshold not greater than warn threshold UNKNOWN Invalid config: fail_percent must be greater than warn_percent
Total size cannot be determined UNKNOWN Cannot determine total disk space for <path>
Read error FAIL Cannot read disk space for path: <resolved path>
No path configured UNKNOWN No path configured

Sizes appear in KB, MB or GB.

The messages Path not found or not a directory and Cannot determine total disk space show the configured path, for example /var. The read-error message instead contains the resolved path with the HOST_ROOT prefix, for example /host/root/var.

The agent needs the volume /:/host/root:ro and HOST_ROOT=/host/root, otherwise the check measures the filesystem inside the agent container, see Agents.