Merge pull request #562 from Icinga:fix/fixes_perfdata_writer_in_jea_context

Fix: PerfData writer in JEA context without REST-Api

Fixes corrupt Performance Data, in case plugins were executed inside a JEA context without the REST-Api.
This commit is contained in:
Lord Hepipud 2022-08-26 22:38:39 +02:00 committed by GitHub
commit 8dff45cbf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View file

@ -27,6 +27,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#552](https://github.com/Icinga/icinga-powershell-framework/pull/552) Fixes file encoding for Icinga for Windows v1.10.0 to ensure the cache is always properly created with the correct encoding
* [#553](https://github.com/Icinga/icinga-powershell-framework/pull/553) Fixes an exception caused by service recovery setting, if the required service was not installed before
* [#556](https://github.com/Icinga/icinga-powershell-framework/pull/556) Fixes the certificate folder not present during first installation, preventing permissions properly set from the start which might cause issues once required
* [#562](https://github.com/Icinga/icinga-powershell-framework/pull/562) Fixes corrupt Performance Data, in case plugins were executed inside a JEA context without the REST-Api
### Enhancements

View file

@ -8,15 +8,7 @@ function Write-IcingaPluginResult()
[string]$CheckResult = $PluginOutput;
if ($PluginPerfData.Count -ne 0) {
[string]$PerfDataContent = '';
foreach ($PerfData in $PluginPerfData) {
$PerfDataContent += $PerfData;
}
if ([string]::IsNullOrEmpty($PerfDataContent) -eq $FALSE) {
$CheckResult += "`n`r| ";
$CheckResult += $PerfDataContent;
}
$CheckResult = [string]::Format('{0}{1}| {2}', $CheckResult, "`r`n", ([string]::Join(' ', $PluginPerfData)));
}
Write-IcingaConsolePlain $CheckResult;