Custom Module Groovy Migration Validation

Last updated on 01 May, 2024

LogicMonitor supports embedded scripting using the Groovy programming language. The release of LogicMonitor EA Collector 34.500 provides support for Apache Groovy 4 in addition to Apache Groovy 2. For more information about the EA Collector release, see the EA Collector 34.500 Release Notes.

Note: LogicMonitor is releasing updates to official LogicMonitor-provided modules to ensure LogicModules are compatible with Apache Groovy 4.

If your environment leverages customized or community-provided modules, you must test your modules to ensure compatibility and make updates as needed. Validating your customized module involves testing the Groovy script with Groovy 2, testing the script with Groovy 4, and then comparing the output from both tests. If the outputs align, the module is considered compatible for the LogicMonitor Collector version that contains both Groovy 2 and Groovy 4.

Note: Additional changes to the modules may be needed when LogicMonitor releases subsequent versions of the Collector that only supports Groovy 4.

Requirements for Validating Customized Modules

To test the customized modules in your portal, you need the Collector 34.500 or later installed.

For more information, see the EA Collector 34.500 Release Notes.

Validating a Customized Module

  1. Navigate to Modules > My Module Toolbox and select the module you want to validate.
  2. From the Details panel, select Edit.
  3. Do the following to test the module with Groovy 2:
    1. In the module editor, select the Collection tab, and add the following comment to the Embedded Groovy Script as the first line:
//!/lib-groovy/v2
println "version=" + GroovySystem.version
  1. Select Test Script .
  2. In the Search Resources field, of the Test Collection Script dialog, enter or search for a resource to test the script.
  3. Select Run Test.
    The test results display in he Test Collection Script dialog.

Recommendation: Take note of the test results before closing the dialog, as these results are compared to the output of the test for Groovy 4. Alternatively, you can open a new tab to test the module with Groovy 4.

  1. Do the following to test the module with Groovy 4:
    1. In the module editor, select the Collection tab, and add the following comment as the first line in the Groovy script:
//!/lib-groovy/v4
println "version=" + GroovySystem.version
  1. Select Test Script .
  2. In the Search Resources field, of the Test Collection Script dialog, enter or search for a resource to test the script.
  3. Select Run Test.
    The test results display in the Test Collection Script dialog.

Compare the test results with Groovy 2 and Groovy 4. If the output matches, the module is valid and can continue to be used for monitoring while using LogicMonitor Collector version 34.500 or later.

Note: Additional changes to modules may be needed when LogicMonitor releases subsequent versions of the Collector that only support Groovy 4.

In This Article