Fix value digit count for Performance Counters

Fixes #97
This commit is contained in:
Lord Hepipud 2020-08-08 14:43:49 +02:00
parent f496aa7184
commit c2ad2b6564
2 changed files with 3 additions and 3 deletions

View file

@ -76,7 +76,7 @@ function New-IcingaPerformanceCounterObject()
try {
[string]$CounterType = $this.PerfCounter.CounterType;
$CounterData.Add('value', $this.PerfCounter.NextValue());
$CounterData.Add('value', ([math]::Round($this.PerfCounter.NextValue(), 6)));
$CounterData.Add('sample', $this.PerfCounter.NextSample());
$CounterData.Add('help', $this.PerfCounter.CounterHelp);
$CounterData.Add('type', $CounterType);

View file

@ -9,6 +9,6 @@ function Format-IcingaPerfDataValue()
}
# Convert our value to a string and replace ',' with a '.' to allow Icinga to parse the output
# In addition, round every output to 2 digits
return (([string]([math]::round($PerfValue, 2))).Replace(',', '.'));
# In addition, round every output to 6 digits
return (([string]([math]::round($PerfValue, 6))).Replace(',', '.'));
}