icinga-powershell-framework/lib/core/tools/Format-IcingaPerfDataValue.psm1
Lord Hepipud 2c96a60e6d Fixed and improved Perf Data handling
* Added proper sorting for checks, packages and check results by name
* Fixed perf data formating to be supported by Icinga 2
* Fixed label naming by removing all invalid characters
* Fixed displaying of values by rounding to 2 digits on floats
2019-09-13 20:44:15 +02:00

14 lines
384 B
PowerShell

function Format-IcingaPerfDataValue()
{
param(
$PerfValue
);
if ((Test-Numeric $PerfValue) -eq $FALSE) {
return $PerfValue;
}
# 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(',', '.'));
}