Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop WinRM Extension #112

Closed
30 tasks done
NassimBtk opened this issue Mar 15, 2024 · 0 comments
Closed
30 tasks done

Develop WinRM Extension #112

NassimBtk opened this issue Mar 15, 2024 · 0 comments
Assignees

Comments

@NassimBtk
Copy link
Member

NassimBtk commented Mar 15, 2024

Description

Check List

Agent

  • Remove the WinRmProtocolConfig class.
  • In ConfigHelper move the validateWinRmInfo() method content to the WinRmConfiguration class which is located in the metricshub-wminrm-extension. And adapt the ConfigHelper code so that we call IConfiguration#validateConfiguration (winrmConfiguration) to validate the content of the WinRm configuration.
  • Add the IConfiguration instance for wmi to the final Map<Class<? extends IConfiguration>, IConfiguration> protocolConfigurations map which is built in ConfigHelper#buildHostConfiguration.
  • In the MetricsHub CLI, adapt the WinRmConfigCli class.
  • Re-write WinRmConfigCli.toProtocol to call the extensionManager instance responsible of building the right IConfiguration for WinRm protocol.
  • If it is required to build a new configuration for WinRm in the unit tests then create a WinRmTestConfiguration class and create its extension WinRmTestExtension.
  • Remove ConfigHelperTest#testValidateWinRmInfo() because the validation will be moved to the WinRmConfiguration class in the metricshub-winrm-extension.
  • Adapt the TaskSchedulingServiceTest to replace the removed classes by the extension classes E.g. WinRmTestConfiguration.
  • Adapt the WinRmConfigCliTest tests. Probably Static Mocks will be involved.

Engine

  • Remove the org.sentrysoftware:winrm & org.sentrysoftware:wmi dependencies from metricshub-engine POM.
  • Move ClientsExecutor.executeWinRm code to the metricshub-winrm-extension. Make sure to remove the call from the ClientsExecutor.executeWql method and adapt the caller (SourceProcessor CriterionProcessor) to invoke the extensionManager correctly.
  • Remove WinRmConfiguration.class mapping from the HostConfiguration#CONFIGURATION_TO_SOURCES_MAP map.
  • Move WinRmConfiguration.java to metricshub-winrm-extension module.
  • Move ProtocolHealthCheckStrategy#checkWinRmHealth to WinRmExtension located at the metricshub-winrm-extension module. Make sure to remove the unused constants and methods.
  • Move the code of the method: CriterionProcessor#CriterionTestResult process(@SpanAttribute("criterion.definition") WmiCriterion WmiCriterion) to the appropriate class in the metricshub-winrm-extension module and call the extensionManager in this process method to execute criterion.
  • Move the code of the method: SourceProcessor#process(@SpanAttribute("source.definition") final WmiSource wmiSource) to the appropriate class in the metricshub-winrm-extension module and call the extensionManager in this process method to execute the source. You will need to factorize the embedded files management, but this should be accessible since the Wmi extension depends on the OsCommand extensions. The other solution consists in creating a common module where both WinRm and OsCommand extensions depend on.
  • Move the WinRmConfigurationTest class to the extension unit tests.
  • Adapt correct engine unit tests because the code is moved to another module.

Extension

  • Implement the IProtocolExtension class.
  • Make sure to accept WinRmConfiguration and execute OsCommands and IPMI Commands.
  • Make sure to accept both wmiSource and osCommandSource (commandLine) sources.
  • Make sure to accept both wmiCriterion and osCommandCriterion criteria.
  • Make sure to implement native WMI executions and OsCommands through WinRm executions.
  • Make sure to define the /metricshub-winrm-extension/src/main/resources/META-INF/services/org.sentrysoftware.metricshub.engine.extension.IProtocolExtension file so that the ServiceLoader loads the extension implementation correctly at runtime.
  • Add the metricshub-engine,lombok, jupiter,jackson (all the necessary dependencies) in the extension project's POM.
  • Make sure to create a jar using the maven-shade-plugin (POM)
  • Make sure to include the required dependencies (org.sentrysoftware:winrm and org.sentrysoftware:metricshub-winrm-extension)
  • Develop unit tests.

Packaging Windows and Linux

  • Add the metricshub-winrm-extension as dependency.
  • Update the maven-dependency-plugin, execution-id: unpack-extensions and add the artifactItem defining the metricshub-winrm-extension.
CherfaElyes added a commit that referenced this issue May 7, 2024
* Created WinRm Extension
* Created WinRm Configuration
CherfaElyes added a commit that referenced this issue May 7, 2024
* Corrected Javadoc
* Refactored WinRm Extension
CherfaElyes added a commit that referenced this issue May 15, 2024
* Completed WinRm extension migration
* Testing in on the engine & the agent
CherfaElyes added a commit that referenced this issue May 15, 2024
* Added unit tests
* Tested the WinRm protocol using the engine & the agent
* Cleaned the source code on the Metricshub-engine
* Updated WinRm pom.xml to add transformers and exclude some artifacts
CherfaElyes added a commit that referenced this issue May 15, 2024
* Added unit tests
* Tested the WinRm protocol using the engine & the agent
* Cleaned the source code on the Metricshub-engine
* Updated WinRm pom.xml to add transformers and exclude some artifacts
* Finalize extension system updates
* Remove all deprecated code
CherfaElyes added a commit that referenced this issue May 15, 2024
CherfaElyes added a commit that referenced this issue May 16, 2024
* Make last updates
* Reduce Jacoco coverage
CherfaElyes added a commit that referenced this issue May 16, 2024
* Make last updates
* Reduce Jacoco coverage
CherfaElyes added a commit that referenced this issue May 16, 2024
* Removed unnecessary files
CherfaElyes added a commit that referenced this issue May 16, 2024
* Added unit test on metricshub-win-common-extension
* Increased tests coverage on metricshub-win-common-extension
NassimBtk added a commit that referenced this issue May 16, 2024
…-winrm-extension

Issue #112:  Develop WinRm Extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants