mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fix perfdata value output on variable overflow
This commit is contained in:
parent
564711c1b6
commit
044ba4bf03
3 changed files with 3 additions and 3 deletions
|
|
@ -50,7 +50,7 @@ Check Command configuration generated by Icinga for Windows 1.2.0 require Icinga
|
||||||
* [#91](https://github.com/Icinga/icinga-powershell-framework/issues/91) Fix wrong default values being set for installer arguments by using the Icinga Director Self-Service API
|
* [#91](https://github.com/Icinga/icinga-powershell-framework/issues/91) Fix wrong default values being set for installer arguments by using the Icinga Director Self-Service API
|
||||||
* [#92](https://github.com/Icinga/icinga-powershell-framework/issues/92) Fix `Set-IcingaAcl` which fails on older Windows systems with a security id error and not at all/not properly setting required permissions for directories
|
* [#92](https://github.com/Icinga/icinga-powershell-framework/issues/92) Fix `Set-IcingaAcl` which fails on older Windows systems with a security id error and not at all/not properly setting required permissions for directories
|
||||||
* [#96](https://github.com/Icinga/icinga-powershell-framework/issues/96) Re-Implements caching for Performance Counters and fixes an issue with counters sometimes returning value 0 instead of the correct value
|
* [#96](https://github.com/Icinga/icinga-powershell-framework/issues/96) Re-Implements caching for Performance Counters and fixes an issue with counters sometimes returning value 0 instead of the correct value
|
||||||
* [#97](https://github.com/Icinga/icinga-powershell-framework/issues/97) Fix value digit count for Performance Counters
|
* [#97](https://github.com/Icinga/icinga-powershell-framework/issues/97), [#101](https://github.com/Icinga/icinga-powershell-framework/issues/101), [#104](https://github.com/Icinga/icinga-powershell-framework/issues/104) Fix value digit count for Performance Counters
|
||||||
|
|
||||||
## 1.1.2 (2020-07-01)
|
## 1.1.2 (2020-07-01)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ function New-IcingaPerformanceCounterObject()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
[string]$CounterType = $this.PerfCounter.CounterType;
|
[string]$CounterType = $this.PerfCounter.CounterType;
|
||||||
$CounterData.Add('value', ([math]::Round($this.PerfCounter.NextValue(), 6)));
|
$CounterData.Add('value', ([math]::Round([decimal]$this.PerfCounter.NextValue(), 6)));
|
||||||
$CounterData.Add('sample', $this.PerfCounter.NextSample());
|
$CounterData.Add('sample', $this.PerfCounter.NextSample());
|
||||||
$CounterData.Add('help', $this.PerfCounter.CounterHelp);
|
$CounterData.Add('help', $this.PerfCounter.CounterHelp);
|
||||||
$CounterData.Add('type', $CounterType);
|
$CounterData.Add('type', $CounterType);
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,5 @@ function Format-IcingaPerfDataValue()
|
||||||
|
|
||||||
# Convert our value to a string and replace ',' with a '.' to allow Icinga to parse the output
|
# Convert our value to a string and replace ',' with a '.' to allow Icinga to parse the output
|
||||||
# In addition, round every output to 6 digits
|
# In addition, round every output to 6 digits
|
||||||
return (([string]([math]::round($PerfValue, 6))).Replace(',', '.'));
|
return (([string]([math]::round([decimal]$PerfValue, 6))).Replace(',', '.'));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue