mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-03 04:09:29 -05:00
Renames "Restart-IcingaWindowsService" to "Restart-IcingaForWindows" and adds alias for backwards compatibility
This commit is contained in:
parent
05f16b3787
commit
b5ffdd10be
24 changed files with 30 additions and 27 deletions
|
|
@ -28,7 +28,7 @@ Import-Module icinga-powershell-framework -Force;
|
||||||
Import-Module icinga-powershell-framework -Global -Force;
|
Import-Module icinga-powershell-framework -Global -Force;
|
||||||
|
|
||||||
# Restart the Icinga for Windows service in case installed, to ensure the functionality
|
# Restart the Icinga for Windows service in case installed, to ensure the functionality
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
|
|
||||||
# Add your own update procedure code
|
# Add your own update procedure code
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
||||||
* [#679](https://github.com/Icinga/icinga-powershell-framework/pull/679) Adds a new data provider for fetching process information of Windows systems, while sorting all objects based on a process name and their process id
|
* [#679](https://github.com/Icinga/icinga-powershell-framework/pull/679) Adds a new data provider for fetching process information of Windows systems, while sorting all objects based on a process name and their process id
|
||||||
* [#688](https://github.com/Icinga/icinga-powershell-framework/pull/688) Adds new handling to add scheduled tasks in Windows for interacting with Icinga for Windows core functionality as well as an auto renewal task for the Icinga for Windows certificate generation
|
* [#688](https://github.com/Icinga/icinga-powershell-framework/pull/688) Adds new handling to add scheduled tasks in Windows for interacting with Icinga for Windows core functionality as well as an auto renewal task for the Icinga for Windows certificate generation
|
||||||
* [#690](https://github.com/Icinga/icinga-powershell-framework/pull/690) Adds automatic renewal of the `icingaforwindows.pfx` certificate for the REST-Api daemon in case the certificate is not yet present, valid or changed during the runtime of the daemon while also making the `icingaforwindows.pfx` mandatory for all installations, regardless of JEA being used or not
|
* [#690](https://github.com/Icinga/icinga-powershell-framework/pull/690) Adds automatic renewal of the `icingaforwindows.pfx` certificate for the REST-Api daemon in case the certificate is not yet present, valid or changed during the runtime of the daemon while also making the `icingaforwindows.pfx` mandatory for all installations, regardless of JEA being used or not
|
||||||
|
* [#692](https://github.com/Icinga/icinga-powershell-framework/pull/692) Renames `Restart-IcingaWindowsService` to `Restart-IcingaForWindows` and adds alias for backwards compatibility to start unifying the Icinga for Windows cmdlets
|
||||||
|
|
||||||
## 1.11.2 (tbd)
|
## 1.11.2 (tbd)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ Below you will find a list of EventId's which are exported by this module. The s
|
||||||
|
|
||||||
| Category | Short Message | Detailed Message |
|
| Category | Short Message | Detailed Message |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Error | Unable to start Icinga for Windows service | Unable to start Icinga for Windows service, as the JEA session created by the service is still active. Run "Restart-IcingaWindowsService" to restart the Icinga for Windows service, while running in JEA context to prevent this issue. |
|
| Error | Unable to start Icinga for Windows service | Unable to start Icinga for Windows service, as the JEA session created by the service is still active. Run "Restart-IcingaForWindows" to restart the Icinga for Windows service, while running in JEA context to prevent this issue. |
|
||||||
|
|
||||||
## Event Id 1504
|
## Event Id 1504
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,5 +77,5 @@ No arguments defined
|
||||||
In order to apply any changes on background daemons, you will always to restart the Icinga for Windows PowerShell service. You can do so with the following command:
|
In order to apply any changes on background daemons, you will always to restart the Icinga for Windows PowerShell service. You can do so with the following command:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -122,5 +122,5 @@ Unregister-IcingaServiceCheck -ServiceId 133219181168290951798237215145107197204
|
||||||
Finally to apply all your changes, we have to restart the Icinga for Windows Powershell Daemon
|
Finally to apply all your changes, we have to restart the Icinga for Windows Powershell Daemon
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ Enable-IcingaFrameworkApiChecks;
|
||||||
Last but not least restart the Icinga for Windows service:
|
Last but not least restart the Icinga for Windows service:
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
```
|
```
|
||||||
|
|
||||||
As long as the feature is enabled, the Icinga for Windows service is running and the REST-Api daemon is registered, checks will be forwarded to the REST-Api and executed, if whitelisted.
|
As long as the feature is enabled, the Icinga for Windows service is running and the REST-Api daemon is registered, checks will be forwarded to the REST-Api and executed, if whitelisted.
|
||||||
|
|
@ -98,7 +98,7 @@ For quick installation, here the list of commands to get everything running:
|
||||||
Register-IcingaBackgroundDaemon -Command 'Start-IcingaWindowsRESTApi';
|
Register-IcingaBackgroundDaemon -Command 'Start-IcingaWindowsRESTApi';
|
||||||
Add-IcingaRESTApiCommand -Command 'Invoke-IcingaCheck*' -Endpoint 'apichecks';
|
Add-IcingaRESTApiCommand -Command 'Invoke-IcingaCheck*' -Endpoint 'apichecks';
|
||||||
|
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
|
|
||||||
Enable-IcingaFrameworkApiChecks;
|
Enable-IcingaFrameworkApiChecks;
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ Register-IcingaBackgroundDaemon -Command 'Start-IcingaAgentServiceTest';
|
||||||
Once registered, you will have to restart the PowerShell service itself to apply the changes
|
Once registered, you will have to restart the PowerShell service itself to apply the changes
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
```
|
```
|
||||||
|
|
||||||
Thats it! Now the daemon is loaded with every start, checking for the Agent state and restart it if it is not running.
|
Thats it! Now the daemon is loaded with every start, checking for the Agent state and restart it if it is not running.
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,7 @@ If our module is providing different endpoints, you will have to create multiple
|
||||||
As everything is now ready, we can restart our Icinga PowerShell Framework service by using
|
As everything is now ready, we can restart our Icinga PowerShell Framework service by using
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
```
|
```
|
||||||
|
|
||||||
and access our API endpoint by browsing to our API location (in our example we assume you use `5668` as default port):
|
and access our API endpoint by browsing to our API location (in our example we assume you use `5668` as default port):
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ Now open a new PowerShell session again and check of the new directory was added
|
||||||
Once the directory is there, restart the `icingapowershell` service by running
|
Once the directory is there, restart the `icingapowershell` service by running
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
```
|
```
|
||||||
|
|
||||||
Now the error should be resolved the the service should be running.
|
Now the error should be resolved the the service should be running.
|
||||||
|
|
@ -119,7 +119,7 @@ Now open a new PowerShell session again and check of the new directory was added
|
||||||
Once the directory is there, restart the `icingapowershell` service by running
|
Once the directory is there, restart the `icingapowershell` service by running
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
```
|
```
|
||||||
|
|
||||||
Now the error should be resolved the the service should be running.
|
Now the error should be resolved the the service should be running.
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ Import-Module -Name 'icinga-powershell-framework' -Global -Force;
|
||||||
|
|
||||||
icinga { Write-Host 'Icinga for Windows successfully repaired' };
|
icinga { Write-Host 'Icinga for Windows successfully repaired' };
|
||||||
|
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
```
|
```
|
||||||
|
|
||||||
Once executed, Icinga for Windows should rebuild the cache and work again as intended. Please keep the `icinga` call within the example, as this will ensure that possible pending migrations of Icinga for Windows will be applied.
|
Once executed, Icinga for Windows should rebuild the cache and work again as intended. Please keep the `icinga` call within the example, as this will ensure that possible pending migrations of Icinga for Windows will be applied.
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ function Install-IcingaForWindowsService()
|
||||||
# will not start without this workaround.
|
# will not start without this workaround.
|
||||||
# Todo: Figure out the reason and fix it properly
|
# Todo: Figure out the reason and fix it properly
|
||||||
Set-IcingaServiceUser -User 'LocalSystem' -Service 'icingapowershell' | Out-Null;
|
Set-IcingaServiceUser -User 'LocalSystem' -Service 'icingapowershell' | Out-Null;
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
Start-Sleep -Seconds 1;
|
Start-Sleep -Seconds 1;
|
||||||
Stop-IcingaWindowsService;
|
Stop-IcingaWindowsService;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ function Invoke-IcingaForWindowsMigration()
|
||||||
Set-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.10.0');
|
Set-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.10.0');
|
||||||
|
|
||||||
if ($ServiceStatus -eq 'Running') {
|
if ($ServiceStatus -eq 'Running') {
|
||||||
Restart-IcingaWindowsService -Service 'icingapowershell';
|
Restart-IcingaForWindows;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -752,7 +752,7 @@ function Start-IcingaAgentInstallWizard()
|
||||||
}
|
}
|
||||||
Test-IcingaAgent;
|
Test-IcingaAgent;
|
||||||
if ($InstallFrameworkService) {
|
if ($InstallFrameworkService) {
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
}
|
}
|
||||||
Restart-IcingaService 'icinga2';
|
Restart-IcingaService 'icinga2';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ function Start-IcingaForWindowsInstallation()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($InstallService) {
|
if ($InstallService) {
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($InstallApiChecks) {
|
switch ($InstallApiChecks) {
|
||||||
|
|
@ -274,7 +274,7 @@ function Start-IcingaForWindowsInstallation()
|
||||||
Enable-IcingaFrameworkApiChecks;
|
Enable-IcingaFrameworkApiChecks;
|
||||||
$InstallRESTApi = $TRUE;
|
$InstallRESTApi = $TRUE;
|
||||||
if ($InstallService) {
|
if ($InstallService) {
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
} else {
|
} else {
|
||||||
Write-IcingaConsoleWarning -Message 'You have selected to install the Api-Check feature and all required configurations were made. The Icinga for Windows service is however not marked for installation, which will cause this feature to not work.';
|
Write-IcingaConsoleWarning -Message 'You have selected to install the Api-Check feature and all required configurations were made. The Icinga for Windows service is however not marked for installation, which will cause this feature to not work.';
|
||||||
}
|
}
|
||||||
|
|
@ -314,7 +314,7 @@ function Start-IcingaForWindowsInstallation()
|
||||||
|
|
||||||
# Always install the Icinga for Windows certificate
|
# Always install the Icinga for Windows certificate
|
||||||
Install-IcingaForWindowsCertificate;
|
Install-IcingaForWindowsCertificate;
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
|
|
||||||
# Update configuration and clear swap
|
# Update configuration and clear swap
|
||||||
$ConfigSwap = Get-IcingaPowerShellConfig -Path 'Framework.Config.Swap';
|
$ConfigSwap = Get-IcingaPowerShellConfig -Path 'Framework.Config.Swap';
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,5 @@ function Invoke-IcingaForWindowsManagementConsoleToggleFrameworkApiChecks()
|
||||||
Enable-IcingaFrameworkApiChecks;
|
Enable-IcingaFrameworkApiChecks;
|
||||||
}
|
}
|
||||||
|
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
|
||||||
'DisabledReason' = 'The Icinga for Windows service is not installed';
|
'DisabledReason' = 'The Icinga for Windows service is not installed';
|
||||||
'AdminMenu' = $TRUE;
|
'AdminMenu' = $TRUE;
|
||||||
'Action' = @{
|
'Action' = @{
|
||||||
'Command' = 'Restart-IcingaWindowsService';
|
'Command' = 'Restart-IcingaForWindows';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ if ($null -eq $IcingaEventLogEnums -Or $IcingaEventLogEnums.ContainsKey('Framewo
|
||||||
1503 = @{
|
1503 = @{
|
||||||
'EntryType' = 'Error';
|
'EntryType' = 'Error';
|
||||||
'Message' = 'Unable to start Icinga for Windows service';
|
'Message' = 'Unable to start Icinga for Windows service';
|
||||||
'Details' = 'Unable to start Icinga for Windows service, as the JEA session created by the service is still active. Run "Restart-IcingaWindowsService" to restart the Icinga for Windows service, while running in JEA context to prevent this issue.';
|
'Details' = 'Unable to start Icinga for Windows service, as the JEA session created by the service is still active. Run "Restart-IcingaForWindows" to restart the Icinga for Windows service, while running in JEA context to prevent this issue.';
|
||||||
'EventId' = 1503;
|
'EventId' = 1503;
|
||||||
};
|
};
|
||||||
1504 = @{
|
1504 = @{
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,6 @@ function Update-Icinga()
|
||||||
# Update JEA profile if JEA is enabled once the update is complete
|
# Update JEA profile if JEA is enabled once the update is complete
|
||||||
if ([string]::IsNullOrEmpty((Get-IcingaJEAContext)) -eq $FALSE -And $UpdateJEA) {
|
if ([string]::IsNullOrEmpty((Get-IcingaJEAContext)) -eq $FALSE -And $UpdateJEA) {
|
||||||
Update-IcingaJEAProfile;
|
Update-IcingaJEAProfile;
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,5 @@ function Install-IcingaSecurity()
|
||||||
Install-IcingaServiceUser -IcingaUser $IcingaUser;
|
Install-IcingaServiceUser -IcingaUser $IcingaUser;
|
||||||
Install-IcingaJEAProfile -IcingaUser $IcingaUser -RebuildFramework:$RebuildFramework -AllowScriptBlocks:$AllowScriptBlocks -ConstrainedLanguage:$ConstrainedLanguage;
|
Install-IcingaJEAProfile -IcingaUser $IcingaUser -RebuildFramework:$RebuildFramework -AllowScriptBlocks:$AllowScriptBlocks -ConstrainedLanguage:$ConstrainedLanguage;
|
||||||
|
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ function Install-IcingaServiceUser()
|
||||||
Set-IcingaUserPermissions -IcingaUser $IcingaUser;
|
Set-IcingaUserPermissions -IcingaUser $IcingaUser;
|
||||||
|
|
||||||
Restart-IcingaService 'icinga2';
|
Restart-IcingaService 'icinga2';
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
|
|
||||||
Clear-IcingaWindowsUserPassword;
|
Clear-IcingaWindowsUserPassword;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
function Restart-IcingaWindowsService()
|
function Restart-IcingaForWindows()
|
||||||
{
|
{
|
||||||
[string]$JeaPid = Get-IcingaJEAServicePid;
|
[string]$JeaPid = Get-IcingaJEAServicePid;
|
||||||
|
|
||||||
|
|
@ -10,3 +10,5 @@ function Restart-IcingaWindowsService()
|
||||||
|
|
||||||
Restart-IcingaService -Service 'icingapowershell';
|
Restart-IcingaService -Service 'icingapowershell';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set-Alias -Name 'Restart-IcingaWindowsService' -Value 'Restart-IcingaForWindows';
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ function Uninstall-IcingaServiceUser()
|
||||||
}
|
}
|
||||||
|
|
||||||
Restart-IcingaService 'icinga2';
|
Restart-IcingaService 'icinga2';
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
|
|
||||||
Write-IcingaConsoleNotice 'User "{0}" including permissions was removed from this host' -Objects $IcingaUser;
|
Write-IcingaConsoleNotice 'User "{0}" including permissions was removed from this host' -Objects $IcingaUser;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,5 @@ function Update-IcingaServiceUser()
|
||||||
Set-IcingaServiceUser -User $IcingaUser -Password $Global:Icinga.ServiceUserPassword -Service 'icingapowershell' | Out-Null;
|
Set-IcingaServiceUser -User $IcingaUser -Password $Global:Icinga.ServiceUserPassword -Service 'icingapowershell' | Out-Null;
|
||||||
|
|
||||||
Restart-IcingaService 'icinga2';
|
Restart-IcingaService 'icinga2';
|
||||||
Restart-IcingaWindowsService;
|
Restart-IcingaForWindows;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ function Invoke-IcingaWindowsScheduledTask()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
'InstallJEA' {
|
'InstallJEA' {
|
||||||
$WinAction = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument ([string]::Format('-Command &{{ Use-Icinga -Minimal; Install-IcingaJEAProfile; Restart-IcingaWindowsService; }}', "'", $TmpFile.FullName, $FilePath))
|
$WinAction = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument ([string]::Format('-Command &{{ Use-Icinga -Minimal; Install-IcingaJEAProfile; Restart-IcingaForWindows; }}', "'", $TmpFile.FullName, $FilePath))
|
||||||
Register-ScheduledTask -TaskName $TaskName -Action $WinAction -RunLevel Highest -TaskPath $TaskPath | Out-Null;
|
Register-ScheduledTask -TaskName $TaskName -Action $WinAction -RunLevel Highest -TaskPath $TaskPath | Out-Null;
|
||||||
Start-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath;
|
Start-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue