icinga-powershell-framework/lib/core/icingaagent/readers/Read-IcingaAgentLogFile.psm1

11 lines
309 B
PowerShell
Raw Normal View History

2019-09-29 12:25:40 -04:00
function Read-IcingaAgentLogFile()
{
$Logfile = Join-Path -Path (Get-IcingaAgentLogDirectory) -ChildPath 'icinga2.log';
if ((Test-Path $Logfile) -eq $FALSE) {
Write-Host 'Icinga 2 logfile not present. Unable to load it';
return;
}
Get-Content -Path $Logfile -Tail 20 -Wait;
2019-09-29 12:25:40 -04:00
}