Adding Groovy Libraries
Last updated on 20 March, 2023The LogicMonitor Collector ships with many useful libraries that you can use from within your Groovy scripts. However, you’ll occasionally need to use a Groovy or Java library that isn’t included with the LogicMonitor Collector. Here’s how to install additional JARs on your collector for additional functionality in your Groovy script LogicModule.
- 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.
- Default library path on Windows –
- 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. - 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
- 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
- Save the config and restart the Collector.