Skip to content

Commit bbbc6ee

Browse files
authored
Merge pull request #358 from Icinga:fix/compare_function_windows2012r2
Fix: Compare function in Windows 2012 R2
2 parents 387d46c + 7614944 commit bbbc6ee

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/31-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1313

1414
### Bugfixes
1515

16+
* [#300](https://github.com/Icinga/icinga-powershell-framework/issues/300) Fixes an issue on `Boolean` to empty `String` conversion for possible maximum values on check plugins on Windows 2012 R2
1617
* [#311](https://github.com/Icinga/icinga-powershell-framework/issues/311) Fixes an issue with negative inputs on some scenarios which will cause an exception for checks instead of continuing executing them properly
1718
* [#317](https://github.com/Icinga/icinga-powershell-framework/pull/317) Fixes certain file names being too long, causing errors on deploying branches
1819
* [#326](https://github.com/Icinga/icinga-powershell-framework/pull/326) Fixes import for module files, by using the full path to the module now instead of the name only, as files could be placed inside a folder which is not listed inside the `$ENV:PSModulePath`

lib/icinga/plugin/New-IcingaCheck.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function New-IcingaCheck()
206206
$this.Maximum = $this.__ThresholdObject.BaseValue;
207207
}
208208

209-
if ($this.Value -gt $this.Maximum -And [string]::IsNullOrEmpty($this.Maximum) -eq $FALSE) {
209+
if ([string]::IsNullOrEmpty($this.Maximum) -eq $FALSE -And (Test-Numeric $this.Maximum) -And (Test-Numeric $this.Value) -And $this.Value -gt $this.Maximum) {
210210
$this.Maximum = $this.__ThresholdObject.RawValue;
211211
}
212212
}

0 commit comments

Comments
 (0)