Skip to content

Commit b5ffdd1

Browse files
committed
Renames "Restart-IcingaWindowsService" to "Restart-IcingaForWindows" and adds alias for backwards compatibility
1 parent 05f16b3 commit b5ffdd1

24 files changed

+30
-27
lines changed

doc/100-General/01-Upgrading.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Import-Module icinga-powershell-framework -Force;
2828
Import-Module icinga-powershell-framework -Global -Force;
2929
3030
# Restart the Icinga for Windows service in case installed, to ensure the functionality
31-
Restart-IcingaWindowsService;
31+
Restart-IcingaForWindows;
3232
3333
# Add your own update procedure code
3434
```

doc/100-General/10-Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
2626
* [#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
2727
* [#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
2828
* [#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
29+
* [#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
2930

3031
## 1.11.2 (tbd)
3132

doc/100-General/20-Eventlog.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Below you will find a list of EventId's which are exported by this module. The s
8484

8585
| Category | Short Message | Detailed Message |
8686
| --- | --- | --- |
87-
| 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. |
87+
| 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. |
8888

8989
## Event Id 1504
9090

doc/110-Installation/05-Background-Daemons.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ No arguments defined
7777
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:
7878

7979
```powershell
80-
Restart-IcingaWindowsService;
80+
Restart-IcingaForWindows;
8181
```

doc/110-Installation/06-Collect-Metrics-over-Time.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,5 @@ Unregister-IcingaServiceCheck -ServiceId 133219181168290951798237215145107197204
122122
Finally to apply all your changes, we have to restart the Icinga for Windows Powershell Daemon
123123

124124
```powershell
125-
Restart-IcingaWindowsService;
125+
Restart-IcingaForWindows;
126126
```

doc/110-Installation/30-API-Check-Forwarder.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Enable-IcingaFrameworkApiChecks;
7575
Last but not least restart the Icinga for Windows service:
7676

7777
```powershell
78-
Restart-IcingaWindowsService;
78+
Restart-IcingaForWindows;
7979
```
8080

8181
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:
9898
Register-IcingaBackgroundDaemon -Command 'Start-IcingaWindowsRESTApi';
9999
Add-IcingaRESTApiCommand -Command 'Invoke-IcingaCheck*' -Endpoint 'apichecks';
100100
101-
Restart-IcingaWindowsService;
101+
Restart-IcingaForWindows;
102102
103103
Enable-IcingaFrameworkApiChecks;
104104
```

doc/900-Developer-Guide/10-Custom-Daemons.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Register-IcingaBackgroundDaemon -Command 'Start-IcingaAgentServiceTest';
301301
Once registered, you will have to restart the PowerShell service itself to apply the changes
302302

303303
```powershell
304-
Restart-IcingaWindowsService;
304+
Restart-IcingaForWindows;
305305
```
306306

307307
Thats it! Now the daemon is loaded with every start, checking for the Agent state and restart it if it is not running.

doc/900-Developer-Guide/12-Custom-API-Endpoints.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ If our module is providing different endpoints, you will have to create multiple
237237
As everything is now ready, we can restart our Icinga PowerShell Framework service by using
238238

239239
```powershell
240-
Restart-IcingaWindowsService;
240+
Restart-IcingaForWindows;
241241
```
242242

243243
and access our API endpoint by browsing to our API location (in our example we assume you use `5668` as default port):

doc/knowledgebase/IWKB000005.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Now open a new PowerShell session again and check of the new directory was added
8383
Once the directory is there, restart the `icingapowershell` service by running
8484

8585
```powershell
86-
Restart-IcingaWindowsService;
86+
Restart-IcingaForWindows;
8787
```
8888

8989
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
119119
Once the directory is there, restart the `icingapowershell` service by running
120120

121121
```powershell
122-
Restart-IcingaWindowsService;
122+
Restart-IcingaForWindows;
123123
```
124124

125125
Now the error should be resolved the the service should be running.

doc/knowledgebase/IWKB000014.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Import-Module -Name 'icinga-powershell-framework' -Global -Force;
3636
3737
icinga { Write-Host 'Icinga for Windows successfully repaired' };
3838
39-
Restart-IcingaWindowsService;
39+
Restart-IcingaForWindows;
4040
```
4141

4242
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.

lib/core/framework/Install-IcingaForWindowsService.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function Install-IcingaForWindowsService()
8787
# will not start without this workaround.
8888
# Todo: Figure out the reason and fix it properly
8989
Set-IcingaServiceUser -User 'LocalSystem' -Service 'icingapowershell' | Out-Null;
90-
Restart-IcingaWindowsService;
90+
Restart-IcingaForWindows;
9191
Start-Sleep -Seconds 1;
9292
Stop-IcingaWindowsService;
9393

lib/core/framework/Invoke-IcingaForWindowsMigration.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function Invoke-IcingaForWindowsMigration()
7575
Set-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.10.0');
7676

7777
if ($ServiceStatus -eq 'Running') {
78-
Restart-IcingaWindowsService -Service 'icingapowershell';
78+
Restart-IcingaForWindows;
7979
}
8080
}
8181

lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ function Start-IcingaAgentInstallWizard()
752752
}
753753
Test-IcingaAgent;
754754
if ($InstallFrameworkService) {
755-
Restart-IcingaWindowsService;
755+
Restart-IcingaForWindows;
756756
}
757757
Restart-IcingaService 'icinga2';
758758
}

lib/core/installer/Start-IcingaForWindowsInstallation.psm1

+3-3
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ function Start-IcingaForWindowsInstallation()
260260
}
261261

262262
if ($InstallService) {
263-
Restart-IcingaWindowsService;
263+
Restart-IcingaForWindows;
264264
}
265265

266266
switch ($InstallApiChecks) {
@@ -274,7 +274,7 @@ function Start-IcingaForWindowsInstallation()
274274
Enable-IcingaFrameworkApiChecks;
275275
$InstallRESTApi = $TRUE;
276276
if ($InstallService) {
277-
Restart-IcingaWindowsService;
277+
Restart-IcingaForWindows;
278278
} else {
279279
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.';
280280
}
@@ -314,7 +314,7 @@ function Start-IcingaForWindowsInstallation()
314314

315315
# Always install the Icinga for Windows certificate
316316
Install-IcingaForWindowsCertificate;
317-
Restart-IcingaWindowsService;
317+
Restart-IcingaForWindows;
318318

319319
# Update configuration and clear swap
320320
$ConfigSwap = Get-IcingaPowerShellConfig -Path 'Framework.Config.Swap';

lib/core/installer/menu/manage/framework/ToogleFrameworkApiChecks.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ function Invoke-IcingaForWindowsManagementConsoleToggleFrameworkApiChecks()
1212
Enable-IcingaFrameworkApiChecks;
1313
}
1414

15-
Restart-IcingaWindowsService;
15+
Restart-IcingaForWindows;
1616
}

lib/core/installer/menu/manage/settings/services/ManageServices.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function Show-IcingaForWindowsMenuManageIcingaForWindowsServices()
9494
'DisabledReason' = 'The Icinga for Windows service is not installed';
9595
'AdminMenu' = $TRUE;
9696
'Action' = @{
97-
'Command' = 'Restart-IcingaWindowsService';
97+
'Command' = 'Restart-IcingaForWindows';
9898
}
9999
},
100100
@{

lib/core/logging/Icinga_EventLog_Enums.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ if ($null -eq $IcingaEventLogEnums -Or $IcingaEventLogEnums.ContainsKey('Framewo
9595
1503 = @{
9696
'EntryType' = 'Error';
9797
'Message' = 'Unable to start Icinga for Windows service';
98-
'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.';
98+
'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.';
9999
'EventId' = 1503;
100100
};
101101
1504 = @{

lib/core/repository/Update-Icinga.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ function Update-Icinga()
5858
# Update JEA profile if JEA is enabled once the update is complete
5959
if ([string]::IsNullOrEmpty((Get-IcingaJEAContext)) -eq $FALSE -And $UpdateJEA) {
6060
Update-IcingaJEAProfile;
61-
Restart-IcingaWindowsService;
61+
Restart-IcingaForWindows;
6262
}
6363
}

lib/core/windows/Install-IcingaSecurity.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ function Install-IcingaSecurity()
2929
Install-IcingaServiceUser -IcingaUser $IcingaUser;
3030
Install-IcingaJEAProfile -IcingaUser $IcingaUser -RebuildFramework:$RebuildFramework -AllowScriptBlocks:$AllowScriptBlocks -ConstrainedLanguage:$ConstrainedLanguage;
3131

32-
Restart-IcingaWindowsService;
32+
Restart-IcingaForWindows;
3333
}

lib/core/windows/Install-IcingaServiceUser.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function Install-IcingaServiceUser()
2525
Set-IcingaUserPermissions -IcingaUser $IcingaUser;
2626

2727
Restart-IcingaService 'icinga2';
28-
Restart-IcingaWindowsService;
28+
Restart-IcingaForWindows;
2929

3030
Clear-IcingaWindowsUserPassword;
3131

lib/core/windows/Restart-IcingaWindowsService.psm1

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Restart-IcingaWindowsService()
1+
function Restart-IcingaForWindows()
22
{
33
[string]$JeaPid = Get-IcingaJEAServicePid;
44

@@ -10,3 +10,5 @@ function Restart-IcingaWindowsService()
1010

1111
Restart-IcingaService -Service 'icingapowershell';
1212
}
13+
14+
Set-Alias -Name 'Restart-IcingaWindowsService' -Value 'Restart-IcingaForWindows';

lib/core/windows/Uninstall-IcingaServiceUser.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function Uninstall-IcingaServiceUser()
2828
}
2929

3030
Restart-IcingaService 'icinga2';
31-
Restart-IcingaWindowsService;
31+
Restart-IcingaForWindows;
3232

3333
Write-IcingaConsoleNotice 'User "{0}" including permissions was removed from this host' -Objects $IcingaUser;
3434
}

lib/core/windows/Update-IcingaServiceUser.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ function Update-IcingaServiceUser()
1717
Set-IcingaServiceUser -User $IcingaUser -Password $Global:Icinga.ServiceUserPassword -Service 'icingapowershell' | Out-Null;
1818

1919
Restart-IcingaService 'icinga2';
20-
Restart-IcingaWindowsService;
20+
Restart-IcingaForWindows;
2121
}

lib/core/wintasks/Invoke-IcingaWindowsScheduledTask.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function Invoke-IcingaWindowsScheduledTask()
6868
}
6969
};
7070
'InstallJEA' {
71-
$WinAction = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument ([string]::Format('-Command &{{ Use-Icinga -Minimal; Install-IcingaJEAProfile; Restart-IcingaWindowsService; }}', "'", $TmpFile.FullName, $FilePath))
71+
$WinAction = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument ([string]::Format('-Command &{{ Use-Icinga -Minimal; Install-IcingaJEAProfile; Restart-IcingaForWindows; }}', "'", $TmpFile.FullName, $FilePath))
7272
Register-ScheduledTask -TaskName $TaskName -Action $WinAction -RunLevel Highest -TaskPath $TaskPath | Out-Null;
7373
Start-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath;
7474

0 commit comments

Comments
 (0)