2020-04-28 07:52:32 -04:00
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
2021-12-09 11:42:06 -05:00
|
|
|
Function to fetch the last executed plugin performance data
|
|
|
|
|
from an internal memory cache in case the Framework is running as daemon.
|
2020-04-28 07:52:32 -04:00
|
|
|
.DESCRIPTION
|
2021-12-09 11:42:06 -05:00
|
|
|
While running the Framework as daemon, check results for plugins are not
|
|
|
|
|
printed into the console but written into an internal memory cache. Once
|
|
|
|
|
a plugin was executed, use this function to fetch the plugin performance data
|
2020-04-28 07:52:32 -04:00
|
|
|
.FUNCTIONALITY
|
2021-12-09 11:42:06 -05:00
|
|
|
Returns the last performance data output for executed plugins while the
|
|
|
|
|
Framework is running as daemon
|
2020-04-28 07:52:32 -04:00
|
|
|
.OUTPUTS
|
2024-08-19 10:13:24 -04:00
|
|
|
System.String
|
2020-04-28 07:52:32 -04:00
|
|
|
.LINK
|
2021-12-09 11:42:06 -05:00
|
|
|
https://github.com/Icinga/icinga-powershell-framework
|
2020-04-28 07:52:32 -04:00
|
|
|
#>
|
|
|
|
|
|
2020-03-25 17:03:31 -04:00
|
|
|
function Get-IcingaCheckSchedulerPerfData()
|
|
|
|
|
{
|
2024-08-19 10:13:24 -04:00
|
|
|
[string]$PerfData = $Global:Icinga.Private.Scheduler.PerformanceData;
|
|
|
|
|
[string]$Global:Icinga.Private.Scheduler.PerformanceData = '';
|
|
|
|
|
|
|
|
|
|
# Ensure we clear our PerfDataWriter cache and storage to have a clean base state for the next plugin execution
|
|
|
|
|
$Global:Icinga.Private.Scheduler.PerfDataWriter.Cache.Clear() | Out-Null;
|
|
|
|
|
$Global:Icinga.Private.Scheduler.PerfDataWriter.Storage.Clear() | Out-Null;
|
2020-03-25 17:03:31 -04:00
|
|
|
|
|
|
|
|
return $PerfData;
|
|
|
|
|
}
|