mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Merge pull request #438 from Icinga:feature/add_restapi_feature_to_imc
Feature: Adds Rest-Api check forwarder to IMC wizard Adds the support for enabling the Rest\-Api including the Api\-Check by running the IMC installation.
This commit is contained in:
commit
28f9f2777e
4 changed files with 56 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
||||||
* [#388](https://github.com/Icinga/icinga-powershell-framework/issues/388) Improves performance for testing if `Add-Type` functions have been added, by adding an internal test for newly introduced environment variables within a PowerShell session
|
* [#388](https://github.com/Icinga/icinga-powershell-framework/issues/388) Improves performance for testing if `Add-Type` functions have been added, by adding an internal test for newly introduced environment variables within a PowerShell session
|
||||||
* [#417](https://github.com/Icinga/icinga-powershell-framework/issues/417) Adds support to allow the force creation of Icinga Agent certificates, even when they are already present on the system over Icinga Management Console installation
|
* [#417](https://github.com/Icinga/icinga-powershell-framework/issues/417) Adds support to allow the force creation of Icinga Agent certificates, even when they are already present on the system over Icinga Management Console installation
|
||||||
* [#427](https://github.com/Icinga/icinga-powershell-framework/issues/427) Moves Icinga for Windows EventLog from `Application` to a custom log `Icinga for Windows`, allowing better separation
|
* [#427](https://github.com/Icinga/icinga-powershell-framework/issues/427) Moves Icinga for Windows EventLog from `Application` to a custom log `Icinga for Windows`, allowing better separation
|
||||||
|
* [#438](https://github.com/Icinga/icinga-powershell-framework/pull/438) Adds support for enabling the REST-Api background daemon and the Api-Check feature during the IMC installation wizard on advanced settings, which will be enabled by default
|
||||||
|
|
||||||
## 1.7.1 (2021-11-11)
|
## 1.7.1 (2021-11-11)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@ function Start-IcingaForWindowsInstallation()
|
||||||
# JEA Profile
|
# JEA Profile
|
||||||
$InstallJEAProfile = Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectInstallJEAProfile';
|
$InstallJEAProfile = Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectInstallJEAProfile';
|
||||||
|
|
||||||
|
# Api Checks
|
||||||
|
$InstallApiChecks = Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectInstallApiChecks';
|
||||||
|
|
||||||
$Hostname = '';
|
$Hostname = '';
|
||||||
$GlobalZones = @();
|
$GlobalZones = @();
|
||||||
$IcingaParentAddresses = @();
|
$IcingaParentAddresses = @();
|
||||||
|
|
@ -255,7 +258,25 @@ function Start-IcingaForWindowsInstallation()
|
||||||
};
|
};
|
||||||
'2' {
|
'2' {
|
||||||
# Do not install JEA profile
|
# Do not install JEA profile
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch ($InstallApiChecks) {
|
||||||
|
'0' {
|
||||||
|
Disable-IcingaFrameworkApiChecks;
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
'1' {
|
||||||
|
Register-IcingaBackgroundDaemon -Command 'Start-IcingaWindowsRESTApi';
|
||||||
|
Add-IcingaRESTApiCommand -Command 'Invoke-IcingaCheck*' -Endpoint 'apichecks';
|
||||||
|
Enable-IcingaFrameworkApiChecks;
|
||||||
|
if ($InstallService) {
|
||||||
|
Restart-IcingaWindowsService;
|
||||||
|
} 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.';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
# Update configuration and clear swap
|
# Update configuration and clear swap
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ function Add-IcingaForWindowsInstallationAdvancedEntries()
|
||||||
Show-IcingaForWindowsInstallationMenuStableRepository -Automated -Advanced;
|
Show-IcingaForWindowsInstallationMenuStableRepository -Automated -Advanced;
|
||||||
Show-IcingaForWindowsInstallerMenuSelectInstallJEAProfile -Automated -Advanced;
|
Show-IcingaForWindowsInstallerMenuSelectInstallJEAProfile -Automated -Advanced;
|
||||||
Show-IcingaForWindowsInstallationMenuEnterIcingaCAServer -Automated -Advanced;
|
Show-IcingaForWindowsInstallationMenuEnterIcingaCAServer -Automated -Advanced;
|
||||||
|
Show-IcingaForWindowsInstallerMenuSelectInstallApiChecks -Automated -Advanced;
|
||||||
|
|
||||||
Enable-IcingaFrameworkConsoleOutput;
|
Enable-IcingaFrameworkConsoleOutput;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
function Show-IcingaForWindowsInstallerMenuSelectInstallApiChecks()
|
||||||
|
{
|
||||||
|
param (
|
||||||
|
[array]$Value = @(),
|
||||||
|
[string]$DefaultInput = '1',
|
||||||
|
[switch]$JumpToSummary = $FALSE,
|
||||||
|
[switch]$Automated = $FALSE,
|
||||||
|
[switch]$Advanced = $FALSE
|
||||||
|
);
|
||||||
|
|
||||||
|
Show-IcingaForWindowsInstallerMenu `
|
||||||
|
-Header 'Please select if you want to enable the Api-Checks feature' `
|
||||||
|
-Entries @(
|
||||||
|
@{
|
||||||
|
'Caption' = 'Do not install Api-Checks feature';
|
||||||
|
'Command' = 'Show-IcingaForWindowsInstallerConfigurationSummary';
|
||||||
|
'Help' = 'Does neither register the REST-Api background daemon nor enables the Api-Check feature';
|
||||||
|
},
|
||||||
|
@{
|
||||||
|
'Caption' = 'Install Api-Checks feature';
|
||||||
|
'Command' = 'Show-IcingaForWindowsInstallerConfigurationSummary';
|
||||||
|
'Help' = 'Enables the Icinga for Windows REST-Api background daemon and enables the Api-Check feature, which results in every check executed by "Exit-IcingaExecutePlugin" to be forwarded to the internal API. This will provide a huge performance boost for plugin execution. Also enables all checks for the namespace "Invoke-IcingaCheck*" to be executed over the Api. The REST-Api is only configured to run on localhost. Requires the Icinga for Windows service to be installed.';
|
||||||
|
}
|
||||||
|
) `
|
||||||
|
-DefaultIndex $DefaultInput `
|
||||||
|
-JumpToSummary:$FALSE `
|
||||||
|
-ConfigElement `
|
||||||
|
-Automated:$Automated `
|
||||||
|
-Advanced:$Advanced;
|
||||||
|
}
|
||||||
|
|
||||||
|
Set-Alias -Name 'IfW-InstallApiChecks' -Value 'Show-IcingaForWindowsInstallerMenuSelectInstallApiChecks';
|
||||||
Loading…
Reference in a new issue