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;;;;
Quota thresholds
-
RebeccaIlene
- Posts: 164
- Joined: Tue Apr 02, 2019 8:38 pm
Quota thresholds
You do not have the required permissions to view the files attached to this post.
Re: Quota thresholds
$percentFree may not be calculated properly. I would include the value stored in this variable in the output.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
RebeccaIlene
- Posts: 164
- Joined: Tue Apr 02, 2019 8:38 pm
Re: Quota thresholds
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;;;;
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
Try the one I've modified for you, see attached (unzip it first).
You do not have the required permissions to view the files attached to this post.
-
RebeccaIlene
- Posts: 164
- Joined: Tue Apr 02, 2019 8:38 pm
Re: Quota thresholds
Thanks Sean.
That works as expected. You can close the case.
That works as expected. You can close the case.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Quota thresholds
Great!RebeccaIlene wrote:Thanks Sean.
That works as expected. You can close the case.
Locking thread