Page 1 of 1

Quota thresholds

Posted: Mon Aug 31, 2020 12:00 pm
by RebeccaIlene
Hi Team,

We are using a power shell script to monitor the quota of windows drives.
When the thresholds are given as warning 10 and critical 5 the alert comes up as critical.
However, when thresholds are given as warning 20 and critical 10 the alert comes up as warning.

Can you please suggest what needs to be modified so that we get the correct output?

PS C:\scripts> .\check_quota.ps1 -Path "F:\Shared Folders\Actuarial" -Warn 10 -Crit 5
CRITICAL: 1,298.95 GB of 1,331.20 GB used, 97.58% used.|usage=1394739931136B;10;5;0; limit=1429365116108B;;;;

PS C:\scripts> .\check_quota.ps1 -Path "F:\Shared Folders\Actuarial" -Warn 20 -Crit 10
WARNING: 1,298.95 GB of 1,331.20 GB used, 97.58% used.|usage=1394739931136B;20;10;0; limit=1429365116108B;;;;

Re: Quota thresholds

Posted: Mon Aug 31, 2020 3:54 pm
by cdienger
$percentFree may not be calculated properly. I would include the value stored in this variable in the output.

Re: Quota thresholds

Posted: Mon Aug 31, 2020 10:23 pm
by RebeccaIlene
Thanks for the suggestion.

I have modified the output to display $percentFree. However, the output is still not correct.


PS C:\scripts> .\check_quota.ps1 -Path "F:\Shared Folders\Actuarial" -Warn 10 -Crit 5
CRITICAL: 1,300.55 GB of 1,331.20 GB used, 97.70% used 2.30% free.|usage=1396450330624B;10;5;0; limit=1429365116108B;;;;

PS C:\scripts> .\check_quota.ps1 -Path "F:\Shared Folders\Actuarial" -Warn 20 -Crit 10
WARNING: 1,300.55 GB of 1,331.20 GB used, 97.70% used 2.30% free.|usage=1396450330624B;20;10;0; limit=1429365116108B;;;;

Re: Quota thresholds

Posted: Tue Sep 01, 2020 3:49 pm
by ssax
Try the one I've modified for you, see attached (unzip it first).
check_quota_modified.zip

Re: Quota thresholds

Posted: Wed Sep 02, 2020 10:21 pm
by RebeccaIlene
Thanks Sean.

That works as expected. You can close the case.

Re: Quota thresholds

Posted: Thu Sep 03, 2020 6:50 am
by scottwilkerson
RebeccaIlene wrote:Thanks Sean.

That works as expected. You can close the case.
Great!

Locking thread