Feature: Adds command to repair Icinga Agent service
In some cases it can happen, that during an upgrade of the Icinga Agent, the service fails because on how the .msi installer works.
This adds a new Cmdlet `Repair-IcingaService`, which resolves the problem and repairs the service.
Fix: Exception on Use-Icinga
In some cases it can happen, that Icinga for Windows throws an exception while using \\\`Use\\\-Icinga\\\`. This happens because of an internal handling for rebuilding the cache, which tried to re\\\-import the modules.
This code seems no longer to be required and causes only problems while trying to use \\\`Use\\\-Icinga\\\` while inside the same shell, that Icinga for Windows is being installed the first time in.
As this seems no longer to be required, we will remove this code.
Fix: Exception on loading by missing environment
Fixes an exception while loading the Framework, caused by a race condition for missing environment variables which are accessed by some plugins before the Framework is loaded properly.
Feature: Adds upgrade notification to service binary
Ensures we add an upgrade notification if we are running the Icinga for Windows Service binary older than v1.2.0, which will not work with Icinga for Windows v1.8.0 or later.
Fix: Rewrite Icinga for Windows service check daemon
Rewrite Icinga for Windows service check daemon for collecting metrics over time, to improve performance, decrease required resources and fix memory leaks.
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.
Fix: Plugin Doc generator file lookup
Fixes a lookup error for existing plugin documentation files, which caused files not being generated properly in case a similar name was already present on the system.
Feature: Moves EventLog out of Application log for IfW
We will move the Icinga for Windows EventLog away from the current \`Application\` log and move it into a custom \`Icinga for Windows\` log, to ensure the \`Application\` log is not spammed with Icinga for Windows events.
Fix: Exception and freezes inside PowerShell ISE session
Fixes Icinga for Windows exception while running \`icinga\` commands or the Icinga Mangement Console inside an \`PowerShell ISE\` session, which behaves differently.
Instead, we now load Icinga for Windows and inform the user about limitations properly.
Fix: Code styling, spelling errors and PSScriptAnalyzer
Fixes lots of code styling, spelling and script analyzer issues.
Disabling UseConsistentIndentation because it is not properly working for multi\-line commands with arguments and array/hashtable objects.
Fix: Removes experimental for API Checks and module requirements
Fixes experimental state of \`API Check\` feature by removing that term and removing the requirement to install \`icinga\-powershell\-restapi\` and \`icinga\-powershell\-apichecks\`
Fix: Icinga Managed User lookup time
Fixes the lookup time if a user is managed by Icinga for Windows or not in large Active Directory environments, by using \`Get\-LocalUser\` instead.
This Cmdlet is available starting with PowerShell 5.0 and later and only required in general for running Icinga for Windows in JEA context. As JEA is only supported starting with PowerShell 5.0 or later, this will not cause any problems.
In case the command is executed on an older system without the \`Get\-LocalUser\` Cmdlet available, Icinga for Windows will handle all users tested with the new implementation as \`not\` managed by Icinga for Windows.
Feature: Adds exception report
Adds a new feature to EventLog writer, allowing to parse an exception report to identity the exact root cause and location, on where the error occurred in first place.
Feature: Allow Force-Creation of certificates for Agent over IMC
Adds support to re\-create the Icinga Agent certificates, even when they are already present on the system. This will resolve the manual requirement to delete the folder or certificates, in case the Icinga CA changes for example
Fix: Sync-IcingaRepository can cause invalid JSON primitive
By using the \`Sync\-IcingaRepository\` function, it might happen that in case the parent site is returning a file listing instead of an error page, the downloaded \*\*repository\*\* file is only the list of the files and not the proper JSON repo file.
Instead we now check the result properly and fallback by adding \`ifw.repo.json\` as it was intended before.
Fix: Version splitting returns "mayor" instead of "major"
Fixes the output value from \`Split\-IcingaVersion\` by returning the object \`major\` in addition to the wrong value \`mayor\`.
We will keep both outputs present for the moment, allowing developers to update their code.
Fix: Username has no length cap for JEA installation
JEA profile installation can fail and cause the Icinga Agent to become defective, in case a username is used being longer than 20 digits.
Fix: Icinga for Windows memory leak
In some scenarios, Icinga for Windows can contain a memory leak, caused by a bug of the Garbage Collector in older PowerShell versions.
We resolve this by enforcing a more aggressive approach on memory cleanup and by collecting all objects being used.
Fix: Performance for Add-Type testing
With recent versions we added a feature to test if Add-Type functions are added to the current PowerShell session, ensuring that the same type is not re-added which caused errors on the error stack.
While the code works perfectly fine, it takes a long time for execution which causes the plugin `Invoke-IcingaCheckDiskHealth` for example, to take way longer than usual.
This PR prepares the future `Private` and `Public` section of the Icinga for Windows environment variables and adds an internal, quick test if a Add-Type function is already added to the current session, once being tested with the old behaviour.
This reduces the disk health plugin execution time after the first run from around 10 seconds to 2 seconds.