Quota thresholds

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
RebeccaIlene
Posts: 164
Joined: Tue Apr 02, 2019 8:38 pm

Quota thresholds

Post 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;;;;
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Quota thresholds

Post by cdienger »

$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

Post 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;;;;
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Quota thresholds

Post by ssax »

Try the one I've modified for you, see attached (unzip it first).
check_quota_modified.zip
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

Post by RebeccaIlene »

Thanks Sean.

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

Post by scottwilkerson »

RebeccaIlene wrote:Thanks Sean.

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

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked