From a218ba8d9228790122833a165a0a805f1ae77066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20K=C3=A4stle?= <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 19 Aug 2025 12:58:48 +0200 Subject: [PATCH] Remove clear variable from disk CheckCommand This commit removes the -C parameter from the disk CheckCommand since there is no possible way to use it in any functional capacity. -C (or --clear) would reset the thresholds given previously to allow for setting different thresholds for following filesystmes. As an example: check_disk -w 50% -c 5% -p / -C -w 1% -p /home would only set the warning threshold for /home. Since there is no way to use it reasonably with the Icinga 2 implementation of check_disk (since thresholds can only be given once and the order is undefined), the clear flag has no worth here. My suggestion is to remove it avoid suggesting that it might be used, but I left it as a comment in the ITL to prevent the next person from "adding a missing parameter". --- doc/10-icinga-template-library.md | 1 - itl/command-plugins.conf | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index d96e89222..26d1b8813 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -414,7 +414,6 @@ disk\_partition | **Optional.** The partition. **Deprecated in 2.3.** disk\_partition\_excluded | **Optional.** The excluded partition. **Deprecated in 2.3.** disk\_partitions | **Optional.** The partition(s). Multiple partitions must be defined as array. disk\_partitions\_excluded | **Optional.** The excluded partition(s). Multiple partitions must be defined as array. -disk\_clear | **Optional.** Clear thresholds. May be true or false. disk\_exact\_match | **Optional.** For paths or partitions specified with -p, only check for exact paths. May be true or false. disk\_errors\_only | **Optional.** Display only devices/mountpoints with errors. May be true or false. disk\_ignore\_reserved | **Optional.** If set, account root-reserved blocks are not accounted for freespace in perfdata. May be true or false. diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 6069e0995..55cc2e4d5 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -1636,6 +1636,9 @@ object CheckCommand "disk" { command = [ PluginDir + "/check_disk" ] arguments = { + /* + "-C" (disk_clear) is missing on purpose, since there is no useful use case possible the way check_disk is mapped here + */ "--extra-opts" = { value = "$disk_extra_opts$" description = "Read extra plugin options from an ini file." @@ -1689,10 +1692,6 @@ object CheckCommand "disk" { key = "-x" value = "$disk_partition_excluded$" } - "-C" = { - set_if = "$disk_clear$" - description = "Clear thresholds" - } "-E" = { set_if = "$disk_exact_match$" description = "For paths or partitions specified with -p, only check for exact paths"