FTMON Exchange

storage · nagios

Root filesystem space

Monitor free space on / with check_disk and retain used-byte history.

Why

FTMON already samples local disks natively, but many sites already operate check_disk from Monitoring Plugins and trust its warn/critical thresholds. This recipe reuses that exact probe while FTMON adds confirmed incidents, bounded history of used bytes on /, and an explicit growth Trend when the filesystem is filling steadily even before the plugin threshold trips.

Install

On Ubuntu 24.04, install the distribution package:

sudo apt update
sudo apt install monitoring-plugins

The executable is /usr/lib/nagios/plugins/check_disk. Upstream documentation: https://www.monitoring-plugins.org/doc/man/check_disk.html.

Configure

Install while FTMON is running — no daemon restart:

ftmon recipe install root-disk

ftmon check install root-disk is equivalent. From a git checkout the recipe is discovered automatically; otherwise set FTMON_EXTRA_MONITORS to your extra-monitors/ directory or pass the recipe path directly.

The default thresholds warn below **20% free** and go critical below **10% free** on /. Edit checks.toml after install if your root volume needs different plugin thresholds; edit growth_bytes_per_h in the monitor TOML for FTMON's steady-growth rule.

Test

Run the exact command as the FTMON user:

/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p / -t 10
echo "$?"

Exit states are 0 OK, 1 warning, 2 critical, and 3 unknown. Fixture output in fixtures/ was taken from Monitoring Plugins 2.3.5 on Ubuntu 24.04.

ftmon check
ftmon doctor

Security and permissions

No elevated privileges are required: the plugin reads filesystem statistics for the chosen mount point. It does not contact the network.

Upstream and licence

The plugin comes from the Monitoring Plugins project and is distributed under GPL-3.0-or-later. FTMON does not redistribute it.

Verified on 2026-07-13 with Monitoring Plugins 2.3.5 (monitoring-plugins 2.3.5-1ubuntu3 on Ubuntu 24.04).

Registry example

[check.root_disk]
# Warn when less than 20% of / is free; critical below 10%. These are plugin-side
# thresholds; FTMON rules confirm plugin state before notifying.
argv = [
  "/usr/lib/nagios/plugins/check_disk",
  "-w", "20%",
  "-c", "10%",
  "-p", "/",
  "-t", "10",
]
protocol = "nagios"
# Outer timeout sits just above the plugin -t so check_disk can return its message.
timeout = "11s"

Monitor definition

schema = 1

[monitor]
name = "root_disk"
description = "Root filesystem used-space history via check_disk"
version = 1
enabled = false
platforms = ["linux"]
interval = "60s"
source = "external"

[source_options]
check = "root_disk"
entity = "mount:/"

[[source_options.perfdata]]
label = "/"
metric = "used_bytes"
plugin_uom = "B"
unit = "bytes"
kind = "gauge"

[parameters]
growth_bytes_per_h = { value = 536870912, doc = "Used-byte growth per hour before warning (512 MiB/h)" }
growth_confidence_min = { value = 0.8, doc = "Required fraction of rising used-byte samples" }

[[derived]]
name = "used_bytes_rate_bph"
expr = 'slope(used_bytes, "6h") * 3600'

[[derived]]
name = "used_bytes_growth_confidence"
expr = 'monot(used_bytes, "6h")'

[[rule]]
id = "plugin-warning"
group = "space"
when = "plugin_state == 1"
severity = "warning"
confirm_cycles = 2
message = "{plugin_message}"

[[rule]]
id = "plugin-critical"
group = "space"
when = "plugin_state == 2"
severity = "critical"
confirm_cycles = 2
message = "{plugin_message}"

[[rule]]
id = "plugin-unknown"
group = "check-health"
when = "plugin_state == 3"
severity = "warning"
confirm_cycles = 2
message = "Root disk check is unknown: {plugin_message}"

[[rule]]
id = "used-bytes-growing"
group = "growth"
when = "used_bytes_rate_bph > growth_bytes_per_h and used_bytes_growth_confidence >= growth_confidence_min"
severity = "warning"
confirm_cycles = 3
message = "Root filesystem used space is steadily increasing"

[[trend]]
id = "used-bytes"
kind = "growth"
title = "Root used-space trend"
value_metric = "used_bytes"
value_unit = "bytes"
rate_metric = "used_bytes_rate_bph"
rate_unit = "bytes/hour"
confidence_metric = "used_bytes_growth_confidence"
confidence_threshold_param = "growth_confidence_min"
rate_threshold_params = ["growth_bytes_per_h"]