mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
15 lines
384 B
PowerShell
15 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(',', '.'));
|
||
|
|
}
|