Skip to content

Remove clear variable from disk CheckCommand #10531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

RincewindsHat
Copy link
Member

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 reasonaly 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".

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 reasonaly 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".
@cla-bot cla-bot bot added the cla/signed label Aug 6, 2025
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR. Seems to work as intended.

For reference:

$ /usr/local/libexec/nagios/check_disk -w 100% -c 100%
DISK CRITICAL [ . . . ]

$ /usr/local/libexec/nagios/check_disk -w 100% -c 100% -C
DISK OK [ . . . ]

@oxzi oxzi added the area/itl Template Library CheckCommands label Aug 18, 2025
@oxzi oxzi added this to the 2.16.0 milestone Aug 19, 2025
Copy link
Member

@oxzi oxzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

FTR, should be merged as a squashed commit.

@oxzi oxzi enabled auto-merge (squash) August 19, 2025 09:11
@oxzi oxzi merged commit a218ba8 into Icinga:master Aug 19, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/itl Template Library CheckCommands cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants