icinga-powershell-framework/lib/core/icingaagent/misc/Show-IcingaAgentObjects.psm1

13 lines
386 B
PowerShell
Raw Normal View History

2019-09-29 12:25:40 -04:00
function Show-IcingaAgentObjects()
{
$Binary = Get-IcingaAgentBinary;
$Output = Start-IcingaProcess -Executable $Binary -Arguments 'object list';
if ($Output.ExitCode -ne 0) {
Write-IcingaConsoleError ([string]::Format('Failed to fetch Icinga Agent objects list: {0}{1}', $Output.Message, $Output.Error));
2019-09-29 12:25:40 -04:00
return $null;
}
return $Output.Message;
}