2019-09-29 12:25:40 -04:00
function Test-IcingaAgent ( )
{
if ( Get-Service 'icinga2' -ErrorAction SilentlyContinue ) {
2020-05-22 10:34:18 -04:00
Write-IcingaTestOutput -Severity 'Passed' -Message 'Icinga Agent service is installed' ;
2019-10-17 16:51:12 -04:00
Test-IcingaAgentServicePermission | Out-Null ;
2019-09-29 12:25:40 -04:00
Test-IcingaAcl " $Env:ProgramData \icinga2\etc " -WriteOutput | Out-Null ;
Test-IcingaAcl " $Env:ProgramData \icinga2\var " -WriteOutput | Out-Null ;
Test-IcingaAcl ( Get-IcingaCacheDir ) -WriteOutput | Out-Null ;
Test-IcingaAgentConfig | Out-Null ;
if ( Test-IcingaAgentFeatureEnabled -Feature 'debuglog' ) {
2020-05-22 10:34:18 -04:00
Write-IcingaTestOutput -Severity 'Warning' -Message 'The debug log of the Icinga Agent is enabled. Please keep in mind to disable it once testing is done, as a huge amount of data is generated'
2019-09-29 12:25:40 -04:00
} else {
2020-05-22 10:34:18 -04:00
Write-IcingaTestOutput -Severity 'Passed' -Message 'Icinga Agent debug log is disabled'
2019-09-29 12:25:40 -04:00
}
} else {
2020-05-22 10:34:18 -04:00
Write-IcingaTestOutput -Severity 'Failed' -Message 'Icinga Agent service is not installed' ;
2019-09-29 12:25:40 -04:00
}
}