Commit graph

1628 commits

Author SHA1 Message Date
Lord Hepipud
46bcb914fc Adds support for cert force creation over IMC 2022-01-04 21:53:28 +01:00
Lord Hepipud
94d09c6b43
Merge pull request #424 from Icinga:fix/repository_sync_can_cause_invalid_json_exception
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.
2022-01-04 20:56:36 +01:00
Lord Hepipud
55a0ce4987 Fixes repo sync by properly checking result 2022-01-04 20:55:34 +01:00
Lord Hepipud
89fbb54b9d
Merge pull request #423 from Icinga:fix/version_splitting_return_object
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.
2022-01-04 20:28:36 +01:00
Lord Hepipud
63f24399b8 Fixes version splitting by returning major object 2022-01-04 20:25:21 +01:00
Lord Hepipud
bca85efcb0
Merge pull request #422 from Icinga:fix/jea_profile_username_length
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.
2022-01-04 20:19:46 +01:00
Lord Hepipud
327bb13d32 Fixes maximum user length for JEA profiles 2022-01-04 20:14:59 +01:00
Lord Hepipud
08cda55428
Merge pull request #418 from Icinga:fix/crash_on_wrong_variable_usage
Fix: Crash on wrong variable usage
2022-01-04 01:29:19 +01:00
Lord Hepipud
0ad5031e60 Fixes crash on wrong variable usage 2022-01-04 01:28:09 +01:00
Lord Hepipud
2bbea22648
Merge pull request #405 from Icinga:fix/garbage_collector_memory_leak
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.
2021-12-09 17:24:37 +01:00
Lord Hepipud
5ed5f0b5e2 Fixes Icinga for Windows memory leak 2021-12-09 17:22:48 +01:00
Lord Hepipud
3163d9237c
Merge pull request #411 from Icinga/Fix_error_message_formating
Add missing parameters for format string
2021-12-08 17:29:24 +01:00
RincewindsHat
b1e2ef2052 Add missing parameters for format string 2021-12-08 17:22:50 +01:00
Lord Hepipud
a49a53204d
Merge pull request #410 from Icinga:fix/improve_test_for_add_type
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.
2021-11-25 13:16:36 +01:00
Lord Hepipud
32c4541397 Improves testing if Add-Type is already loaded 2021-11-25 13:12:57 +01:00
Lord Hepipud
2832383d22
Merge pull request #408 from Icinga:doc/updates_roadmap
Doc: Updates roadmap
2021-11-18 16:13:50 +01:00
Lord Hepipud
6d6f46c895 Updates roadmap 2021-11-18 16:12:49 +01:00
Lord Hepipud
452f8019de
Merge pull request #407 from Icinga:fix/remove_unnecessary_module_loading
Fix: Removes unnecessary module import

Removes not required import of PowerShell modules for `Invoke-IcingaNamespaceCmdlets`, as by the time we fetch the content the specified module must be loaded already.

In addition adds proper error output in case something goes wrong. Errors are written directly into the EventLog.
2021-11-18 15:45:26 +01:00
Lord Hepipud
f602b242b1 Removes unnecessary module import from namespace 2021-11-18 15:42:47 +01:00
Lord Hepipud
2ce536c95e
Merge pull request #404 from Icinga:fix/rest_api_listen_address
Fix: REST-Api address argument not being used

Fixes missing address attribute for REST-Api daemon, making it unable to change the listening address
2021-11-16 17:15:10 +01:00
Lord Hepipud
79d22ef127 Fixes Rest-Api address argument not being used 2021-11-16 16:28:00 +01:00
Lord Hepipud
3c9249444a
Merge pull request #403 from Icinga:fix/memory_leak_on_eventlog_reader
Fix: Memory leak on EventLog reader

With Icinga for Windows v1.7.0 we introdocued a way to read EventLog entries as stream directly into the CLI.
If used for a long time, the memory consumption of this active shell will increase over time, as the Garbage Collector does not kick in.

This will fix the issue by forcing the GC to be called after each loop cycle.
2021-11-15 12:10:04 +01:00
Lord Hepipud
ba2c075982 Fixes memory leak on EventLog reader 2021-11-15 12:09:14 +01:00
Lord Hepipud
513b7db1c4
Merge pull request #400 from Icinga:fix/repo_hash_generator
Fix: Repo hash generator causes file hashes to never compare

Fixes repository file hash generator, which now only includes .zip and .msi files, which otherwise turned into invalid hashes because of the repository index file always changing based on the assigned hash, resulting in a different repository hash
2021-11-11 15:56:49 +01:00
Lord Hepipud
83d1bbae8a Fixes repo hash generator to only include zip/msi 2021-11-11 15:56:20 +01:00
Lord Hepipud
6a51086f6c
Merge pull request #401 from Icinga:fix/repository_manager_not_using_icinga_webrequests
Fix: Repository Manager is not using Icinga Web-Requests

Fixes the repository manager by now using Icinga WebRequests instead of Windows WebRequests, allowing the usage of the internal proxy feature.
2021-11-11 10:23:51 +01:00
Lord Hepipud
737a8fe80c Fix web requests for repos not using icinga Cmdlet 2021-11-11 10:21:53 +01:00
Lord Hepipud
6d51f01570
Merge pull request #398 from Icinga:fix/remove_stringbuilder_output_from_new_component
Fix: Removes String.Builder output while creating new components

Fixes String.Builder object output, while creating new components by using `New-IcingaForWindowsComponent`
2021-11-10 10:30:43 +01:00
Lord Hepipud
96476dbf41 Fixes object output of string builder 2021-11-10 10:29:22 +01:00
Lord Hepipud
e4c879f538 Sets next version to v1.8.0 2021-11-09 09:39:35 +01:00
Lord Hepipud
6fb630cf8c
Merge pull request #397 from Icinga:doc/fix_thresholdinterval_object_type
Fix: ThresholdInterval data type in plugin docs

Fixes `-ThresholdInterval` data type inside auto generated docs for plugins, which was of type `Object`, but should be of type `String`
2021-11-08 16:50:36 +01:00
Lord Hepipud
22a6a72568 Fixes thresholdinterval data type in docs 2021-11-08 16:49:33 +01:00
Lord Hepipud
b92d6d52da
Merge pull request #396 from Icinga:feature/add_plugin_documentation_creation
Feature: Adds function to create plugin documentation

Adds new function `Publish-IcingaPluginDocumentation` which was previously only available within the plugins package.
2021-11-08 16:37:08 +01:00
Lord Hepipud
4a4c49d886 Adds function to create plugin documentation 2021-11-08 16:36:40 +01:00
Lord Hepipud
aa4750e92a
Merge pull request #389 from Icinga:feature/developer_tools
Feature: Adds developer tools for easier start and management

Adds additional Cmdlets to get working on new Icinga for Windows components and publishing of  modules including validation alot easier.

`New-IcingaForWindowsComponent`: Creates an entire new module structure depending on input values, to get a base skeleton for further development ready

`Publish-IcingaForWindowsComponent`: Properly adds documentation, possible plugin configuration and dependencies of files to the manifest file, ensuring the integrity of the module

`Test-IcingaForWindowsComponent`: Allows to test your module and checks for code styling issues and errors as well as testing the module itself, if it can be imported, printing errors in case of problems

`Open-IcingaForWindowsComponentInEditor`: Allows to open a certain Icinga for Windows component in an editor to get started a lot easier. Only supports `Visual Studio Code` at the moment
2021-11-07 12:14:23 +01:00
Lord Hepipud
495e0d05c3 Adds developer utilities 2021-11-07 12:10:05 +01:00
Lord Hepipud
3fdd13ddac
Merge pull request #393 from Icinga:feature/generic_eventlog_reader_and_ifw_reader
Feature: Adds generic EventLog reader and IfW reader

Adds generic reader function `Read-IcingaWindowsEventLog`, allowing to read any EventLog as stream on the console and adds in addition `Read-IcingaForWindowsLog` for reading Icinga for Windows specific logs
2021-11-05 13:37:43 +01:00
Lord Hepipud
f4dd59461c Adds generic EventLog reader and IfW reader 2021-11-05 13:37:06 +01:00
Lord Hepipud
b4ced772f5
Merge pull request #392 from Icinga:feature/add_support_for_eventlog_reader
Feature: Adds support to read EventLog for logs

Starting with Icinga 2.13.0, the Agent will write to the Windows EventLog by default. Our `Read-IcingaAgentLogFile` Cmdlet will now support both and read from the EventLog if the feature is enabled and 2.13.0 or later is being installed
2021-11-04 18:53:57 +01:00
Lord Hepipud
a1fdb854ec Adds support to read EventLog for logs 2021-11-04 18:51:02 +01:00
Lord Hepipud
d759a4dd31
Merge pull request #390 from Icinga:fix/threshold_interval_fails_on_minute_to_hour_conversion
Fix: Thershold interval time conversion

Fixes an issue with `-ThresholdInterval` unit conversion, which causes an error if you want to convert `60m` or `1h`, as the used object is returning 0 for minutes in this matter, as the object itself moved to hours instead.

We should use `TotalMinutes` instead of `Minutes` on our `TimeSpan` object and round every single value returned to 0 digits.
2021-11-03 17:27:21 +01:00
Lord Hepipud
bfd0237256 Fixes thershold interval time conversion 2021-11-03 17:23:42 +01:00
Lord Hepipud
6e9f256d98
Merge pull request #387 from Icinga:fix/use_alias_for_command_args_on_config_generation_if_available
Fix: Use alias for args name on config generation

In case we are using aliases for command arguments/parameters, we should always use the first alias we find as argument instead of using the real name.
2021-10-28 17:29:46 +02:00
Lord Hepipud
cf2125d7a2 Use alias for args name on config generation 2021-10-28 17:28:41 +02:00
Lord Hepipud
ba941c1eca
Merge pull request #386 from Icinga:fix/check_generator_for_alias_checks
Fix: Check command generator for aliases

In case we are using aliases for check commands, to keep backwards compatibility, we have to ensure that check commands actually use the name of the alias for custom variables, to not break the naming and prevent wrong usage of custom variables.
2021-10-28 16:33:25 +02:00
Lord Hepipud
6cb7743954 Fixes check command generator for aliases 2021-10-28 16:13:35 +02:00
Lord Hepipud
97ebe4613d
Merge pull request #385 from Icinga:doc/adds_win11_win2022_support_matrix
Doc: Adds Windows 11 and Windows 2022 to support matrix
2021-10-27 11:51:14 +02:00
Lord Hepipud
70565570f9 Adds Win 11 and Win 2022 to support matrix 2021-10-27 11:50:19 +02:00
Lord Hepipud
22b493b24a
Merge pull request #384 from Icinga:fix/removes_module_loaded_testing
Fix: Module not loaded exception

Fixes an exception, telling the user a module is not loaded or installed, while the check itself returned a false value.

However, this check in general is useless and should be removed, as we can only check for components being loaded already, making it impossible to verify that a command is not available and loading the corresponding module, as we are unable to detect which module belongs to the command.

Therefor the entire test for this just causes CPU overhead and loading time for nothing.
2021-10-27 11:04:31 +02:00
Lord Hepipud
da9819de14 Fixes module not loaded exception 2021-10-27 11:01:00 +02:00