mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-03 04:09:29 -05:00
22 lines
728 B
PowerShell
22 lines
728 B
PowerShell
# Load the basic framework data
|
|
Use-Icinga -Minimal;
|
|
|
|
# Wait 10 seconds before procedding
|
|
Start-Sleep -Seconds 10;
|
|
|
|
# Fetch the process information for JEA and the Icinga for Windows PID
|
|
$JeaProcess = Get-Process -Id (Get-IcingaJEAServicePid) -ErrorAction SilentlyContinue;
|
|
$IfWProcess = Get-Process -Id (Get-IcingaForWindowsServicePid) -ErrorAction SilentlyContinue;
|
|
|
|
# Set the JEA pid to below normal
|
|
if ($null -ne $JeaProcess -And $JeaProcess.ProcessName -eq 'wsmprovhost') {
|
|
$JeaProcess.PriorityClass = 'BelowNormal';
|
|
}
|
|
|
|
# Set the Icinga for Windows pid to below normal
|
|
if ($null -ne $IfWProcess -And $IfWProcess.ProcessName -eq 'powershell') {
|
|
$IfWProcess.PriorityClass = 'BelowNormal';
|
|
}
|
|
|
|
# Exit with okay
|
|
exit 0;
|