Revise Query

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
angus
Posts: 125
Joined: Thu May 28, 2015 8:17 am

Re: Revise Query

Post by angus »

Attached is my attempt, i am clearly doing something wrong.
Thanks.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Revise Query

Post by ssax »

RDP into the VIP and then give us the disk management screenshot like you did with the other.


Thank you
angus
Posts: 125
Joined: Thu May 28, 2015 8:17 am

Re: Revise Query

Post by angus »

RDPing into the cluster VIP just takes me to the same server i provided the screen shot for earlier in this ticket.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Revise Query

Post by ssax »

Hmm, interesting, does the inactive node show anything different?
angus
Posts: 125
Joined: Thu May 28, 2015 8:17 am

Re: Revise Query

Post by angus »

No, the same result.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Revise Query

Post by ssax »

To be honest, I'm not sure if this is a bug or expected behavior in regards to reserved disks being locked to the initiator. Either way, we won't be able to get the built in API disk check one working with this quickly, we'll likely have to use a powershell script to get the information, will that work for you?

I've created a bug report for this anyways:

https://github.com/NagiosEnterprises/ncpa/issues/231
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Revise Query

Post by jomann »

Currently the module we use in NCPA does not take into account the root reserved space for % but I actually just put in a bug report and we fixed it in the module. It should be fixed in NCPA 2.0.0.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
angus
Posts: 125
Joined: Thu May 28, 2015 8:17 am

Re: Revise Query

Post by angus »

I am happy to work out a PS script to pull this info. Do you have anything pre-compiled?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Revise Query

Post by ssax »

This should work:

Code: Select all

$diskName = $Args[0]
$warning = $Args[1]
$critical = $Args[2]

$used_percent = ((gdr -PSProvider 'FileSystem' -Name "$diskName" | select @{L='used_percent';E={"{0:N2}" -f (100-(($_.free/($_.used+$_.free))*100))}}).used_percent | Out-String) -replace "`n|`r"

if ($used_percent -gt $critical) {
	Write-Host "CRITICAL - Disk $diskName is $used_percent% used! (> $critical%) |'used_percent'=$used_percent%;$warning;$critical;"
	exit 2
} elseif ($used_percent -gt $warning) {
	Write-Host "WARNING - Disk $diskName is $used_percent% used! (> $warning%) |'used_percent'=$used_percent%;$warning;$critical;"
	exit 1
} else {
	Write-Host "OK - Disk $diskName is $used_percent% used. |'used_percent'=$used_percent%;$warning;$critical;"
	exit 0
}
Then just pass in the disk letter, the warning percent, and the critical percent:

Code: Select all

PS C:\scripts> .\disk_check.ps1 C 80 95
WARNING - Disk C is 90.50% used! (> 80%) |'used_percent'=90.50%;80;95;
angus
Posts: 125
Joined: Thu May 28, 2015 8:17 am

Re: Revise Query

Post by angus »

I am trying to setup the command and the service for this script but i am having trouble. I guess i need a little more hand holding. Can you spell out the command i need to create and provide the service syntax. Sorry, I have been testing this for over an hour without success.

Thanks.
Locked