Skip to content

Commit a218ba8

Browse files
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".
1 parent d158276 commit a218ba8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

doc/10-icinga-template-library.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ disk\_partition | **Optional.** The partition. **Deprecated in 2.3.**
414414
disk\_partition\_excluded | **Optional.** The excluded partition. **Deprecated in 2.3.**
415415
disk\_partitions | **Optional.** The partition(s). Multiple partitions must be defined as array.
416416
disk\_partitions\_excluded | **Optional.** The excluded partition(s). Multiple partitions must be defined as array.
417-
disk\_clear | **Optional.** Clear thresholds. May be true or false.
418417
disk\_exact\_match | **Optional.** For paths or partitions specified with -p, only check for exact paths. May be true or false.
419418
disk\_errors\_only | **Optional.** Display only devices/mountpoints with errors. May be true or false.
420419
disk\_ignore\_reserved | **Optional.** If set, account root-reserved blocks are not accounted for freespace in perfdata. May be true or false.

itl/command-plugins.conf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,9 @@ object CheckCommand "disk" {
16361636
command = [ PluginDir + "/check_disk" ]
16371637

16381638
arguments = {
1639+
/*
1640+
"-C" (disk_clear) is missing on purpose, since there is no useful use case possible the way check_disk is mapped here
1641+
*/
16391642
"--extra-opts" = {
16401643
value = "$disk_extra_opts$"
16411644
description = "Read extra plugin options from an ini file."
@@ -1689,10 +1692,6 @@ object CheckCommand "disk" {
16891692
key = "-x"
16901693
value = "$disk_partition_excluded$"
16911694
}
1692-
"-C" = {
1693-
set_if = "$disk_clear$"
1694-
description = "Clear thresholds"
1695-
}
16961695
"-E" = {
16971696
set_if = "$disk_exact_match$"
16981697
description = "For paths or partitions specified with -p, only check for exact paths"

0 commit comments

Comments
 (0)