Page 2 of 3
Re: Revise Query
Posted: Fri Jun 03, 2016 12:51 pm
by angus
Attached is my attempt, i am clearly doing something wrong.
Thanks.
Re: Revise Query
Posted: Fri Jun 03, 2016 1:16 pm
by ssax
RDP into the VIP and then give us the disk management screenshot like you did with the other.
Thank you
Re: Revise Query
Posted: Mon Jun 06, 2016 8:37 am
by angus
RDPing into the cluster VIP just takes me to the same server i provided the screen shot for earlier in this ticket.
Re: Revise Query
Posted: Mon Jun 06, 2016 5:10 pm
by ssax
Hmm, interesting, does the inactive node show anything different?
Re: Revise Query
Posted: Tue Jun 07, 2016 1:36 pm
by angus
No, the same result.
Re: Revise Query
Posted: Tue Jun 07, 2016 5:01 pm
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
Re: Revise Query
Posted: Tue Jun 07, 2016 7:20 pm
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.
Re: Revise Query
Posted: Wed Jun 08, 2016 8:52 am
by angus
I am happy to work out a PS script to pull this info. Do you have anything pre-compiled?
Re: Revise Query
Posted: Wed Jun 08, 2016 2:57 pm
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;
Re: Revise Query
Posted: Mon Jun 13, 2016 8:46 am
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.