Forum Discussion

AustinC's avatar
AustinC
Icon for Neophyte rankNeophyte
3 years ago

Collector Libraries + IntelliJ/Other IDE?

Has anyone monkeyed with integrating Collector Libraries with IntelliJ or another IDE? I'm reaching a point where some of my batchscripts are pretty complex, and while the Debug mode (with Debug Script Helper plugin) is _super_ handy (and far more than I would expect of any given platform), I find myself _really_ wanting more functionality to assist in debugging. I've recently invested in IntelliJ, and it's functionalities have helped a TON with some of our automations using the LM API.

It seems well within the realm of possibility to incorporate some of the collector libraries into IntelliJ, but I imagine it's not necessarily drag and drop.

Has anyone tried this yet?

  • @Austin Culbertson I did this when I was a Module Engineer.

    If you create a "Library", you can point to a folder with all of your collector JARs ( I just SCPed the logicmonitor/agent/lib directory from my collector to my laptop ). IntelliJ will read through, and then you'll be able to autocomplete and see everything the collector has to offer. We have some internal documentation I can see about getting published, but it's fairly easy to do.


    Not everything works, notably the built-in Http convenience class, as it expects some local files.

    You may need to delete the xml-apis JAR or IntelliJ will complain, if you're doing XML parsing.

  • @Austin Culbertson I did this when I was a Module Engineer.

    If you create a "Library", you can point to a folder with all of your collector JARs ( I just SCPed the logicmonitor/agent/lib directory from my collector to my laptop ). IntelliJ will read through, and then you'll be able to autocomplete and see everything the collector has to offer. We have some internal documentation I can see about getting published, but it's fairly easy to do.


    Not everything works, notably the built-in Http convenience class, as it expects some local files.

    You may need to delete the xml-apis JAR or IntelliJ will complain, if you're doing XML parsing.

  • 19 hours ago, Michael Rodrigues said:

    @Austin Culbertson I did this when I was a Module Engineer.

    If you create a "Library", you can point to a folder with all of your collector JARs ( I just SCPed the logicmonitor/agent/lib directory from my collector to my laptop ). IntelliJ will read through, and then you'll be able to autocomplete and see everything the collector has to offer. We have some internal documentation I can see about getting published, but it's fairly easy to do.


    Not everything works, notably the built-in Http convenience class, as it expects some local files.

    You may need to delete the xml-apis JAR or IntelliJ will complain, if you're doing XML parsing.

    Awesome, thanks. I'll give this a shot.

  • Gonna tag off of this, because this is something I have been trying to stand up.

    I am able to create a project in IntelliJ and have it pull down Groovy and able to test a few things before I go into LogicMonitor. But LM also has a few extra libraries. I tried adding the libraries as external, I tried a clean fresh project and just used the lib folder from agent. But each time I get a

    Error: Could not find or load main class org.codehaus.groovy.tools.GroovyStarter

     

  • @Joe Williams did you configure IntelliJ to use your groovy installation? It's added as a "library" in intelliJ.

    You'll also want to make sure you're using the same version of groovy as ships with your collector. There should be a groovy jar in your collector install folder with a version number in the file name.