Skip to content
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

Hard Limit Quota isn't working - Checking if used is higher then hard limit (will never be) #70

Open
it-ops-liron opened this issue Feb 19, 2018 · 0 comments

Comments

@it-ops-liron
Copy link

Broken Feature - Quota Hard Limit

Bug report

Issue Detail

  • check_netapp_ontap version: All
  • NetApp Ontap version: 8.3.2P5

Expected Behavior
I use Hard quota on my QTrees,
When quota is about to be full I need an alert,
I expect something like this:
ERROR: volume_name/qtree_name - HARD Quota at 87%

Actual Behavior
The code do this:

if (used >= hard-quota) {
    alert
}

This will not work due to the fact that the used space/files will never exceed the hard-quota
So the result is always:
OK - No problems found (77 checked)

Suggested Solution
I've done the following:

  • Top of the code added:
# DEFUALTS
my $QUOTA_HARD_LIMIT_ERROR_THRESHOLD = 0.85;
  • in sub calc_quota_health changed these:
       if ($hrefQuotaInfo->{$strQuota}->{'space-hard-limit'} ne "-") {
            # Fixing bug - The test that space-used is > then space-hard-limit is wrong - spaced-used can never be bigger!
            my $quotaPrecentage = $hrefQuotaInfo->{$strQuota}->{'space-used'} / $hrefQuotaInfo->{$strQuota}->{'space-hard-limit'};
            #if ($hrefQuotaInfo->{$strQuota}->{'space-used'} >= $hrefQuotaInfo->{$strQuota}->{'space-hard-limit'}) {
            if ($quotaPrecentage >= $QUOTA_HARD_LIMIT_ERROR_THRESHOLD) {
  • and These lines:
        if ($hrefQuotaInfo->{$strQuota}->{'files-hard-limit'} ne "-") {
            # Fixing bug - the test that files-used is > then files-hard-limit is wrong - files-used can never be bigger!
            #if ($hrefQuotaInfo->{$strQuota}->{'files-used'} >= $hrefQuotaInfo->{$strQuota}->{'files-hard-limit'}) {
            my $quotaPrecentage = $hrefQuotaInfo->{$strQuota}->{'files-used'} / $hrefQuotaInfo->{$strQuota}->{'files-hard-limit'};
            if ($quotaPrecentage >= $QUOTA_HARD_LIMIT_ERROR_THRESHOLD) {
  • Result is something like this:
    virtual_storage_node/volume/qtree - 146.37GB/170.00GB SPACE USED
    With exit code of 2.

This should resolve the issue (but still missing the ability to set CRITICAL or ERROR thresholds)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants