Adding Groovy Libraries

Last updated on 16 June, 2023

Along with other installation files, collector installer also carries multiple AWS SDK JARs which are used in the core and custom modules (DataSources). To ensure that the size of collector installer remains light, starting with Collector EA version 34.100, we ship only the following AWS SDK JARs which are used by collector and core modules.

  • aws-java-sdk-core
  • aws-java-sdk-autoscaling
  • aws-java-sdk-ec2
  • aws-java-sdk-s3
  • aws-java-sdk-cloudformation
  • aws-java-sdk-cloudwatch
  • aws-java-sdk-dynamodb
  • aws-java-sdk-sqs

After upgrading to EA 34.100, if you try to use an AWS SDK JAR (which is not shipped with collector installer) in a groovy script of the custom datasource (existing or new), then data will not be collected for that datasource. You will see errors such as “unable to resolve class <classname>“. In such cases or if your business needs additional AWS SDK JAR, you can add them as custom JAR. Follow the steps to install additional JARs on your collector for additional functionality in your Groovy script LogicModule.

  1. Copy the jar file to the library folder in the Collector installation (you may have to create the folder):
    • Default library path on Windows – C:\Program Files\LogicMonitor\agent\custom
    • Default path on Linux – /usr/local/logicmonitor/agent/custom

    Previously, we directed users to put custom JARs in the lib directory with the included JARs. While this still works, we recommend putting your custom jars in the separate custom folder.

  2. Now edit wrapper.conf so the Collector will load the jar. You can edit the configuration file directly on the machine, or from within your LogicMonitor portal in a browser. For more information on editing the Collector config file, see Editing the Collector Config Files.
  3. In the wrapper.conf file, you’ll see lines like this:
    wrapper.java.classpath.85=../lib/jackson-core-2.6.6.jar
    wrapper.java.classpath.86=../lib/amazonlibs/*.jar
    
  4. Being sure to increment the number, add a line for your jar:
    wrapper.java.classpath.85=../lib/jackson-core-2.6.6.jar
    wrapper.java.classpath.86=../lib/amazonlibs/*.jar
    wrapper.java.classpath.87=../custom/customlib-0.0.1.jar
    
  5. Save the config and restart the Collector.