icinga-powershell-framework/lib/core/jea/Test-IcingaJEAServiceRunning.psm1
2022-02-15 15:47:01 +01:00

29 lines
614 B
PowerShell

function Test-IcingaJEAServiceRunning()
{
param (
[string]$JeaPid = $null
);
if ([string]::IsNullOrEmpty($JeaPid)) {
[string]$JeaPid = Get-IcingaJEAServicePid;
}
if ([string]::IsNullOrEmpty($JeaPid)) {
return $FALSE;
}
if ($JeaPid -eq '0' -Or $JeaPid -eq 0) {
return $FALSE;
}
$JeaPowerShellProcess = Get-Process -Id $JeaPid -ErrorAction SilentlyContinue;
if ($null -eq $JeaPowerShellProcess) {
return $FALSE;
}
if ($JeaPowerShellProcess.ProcessName -ne 'wsmprovhost') {
return $FALSE;
}
return $TRUE;
}