icinga-powershell-framework/lib/core/tools/Format-IcingaPerfDataValue.psm1
2020-08-20 10:13:09 +02:00

14 lines
393 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 6 digits
return (([string]([math]::round([decimal]$PerfValue, 6))).Replace(',', '.'));
}