mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fixed return values and NULL objects for OutOfRange comparison
This commit is contained in:
parent
e9583382f5
commit
c82bdad7cc
1 changed files with 5 additions and 1 deletions
|
|
@ -41,7 +41,7 @@ function New-IcingaCheck()
|
||||||
param($warning);
|
param($warning);
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($warning)) {
|
if ([string]::IsNullOrEmpty($warning)) {
|
||||||
return;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Test-Numeric $warning)) {
|
if ((Test-Numeric $warning)) {
|
||||||
|
|
@ -223,6 +223,10 @@ function New-IcingaCheck()
|
||||||
$Check | Add-Member -membertype ScriptMethod -name 'CritOutOfRange' -value {
|
$Check | Add-Member -membertype ScriptMethod -name 'CritOutOfRange' -value {
|
||||||
param($critical);
|
param($critical);
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($critical)) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
if ((Test-Numeric $critical)) {
|
if ((Test-Numeric $critical)) {
|
||||||
$this.CritIfGreaterThan($critical).CritIfLowerThan(0) | Out-Null;
|
$this.CritIfGreaterThan($critical).CritIfLowerThan(0) | Out-Null;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue