icinga-powershell-framework/lib/core/framework/Get-IcingaCheckSchedulerPluginOutput.psm1

25 lines
848 B
PowerShell
Raw Normal View History

2020-04-28 07:52:32 -04:00
<#
.SYNOPSIS
Function to fetch the last executed plugin output from an internal memory
cache in case the Framework is running as daemon.
.DESCRIPTION
While running the Framework as daemon, checkresults 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 output
.FUNCTIONALITY
Returns the last checkresult output for executed plugins while the
Framework is running as daemon
.OUTPUTS
System.Object
.LINK
https://github.com/Icinga/icinga-powershell-framework
#>
function Get-IcingaCheckSchedulerPluginOutput()
{
2021-12-09 11:42:06 -05:00
$CheckResult = [string]::Join("`r`n", $Global:Icinga.Private.Scheduler.CheckResults);
$Global:Icinga.Private.Scheduler.CheckResults = @();
return $CheckResult;
}