Forum Discussion

therealsle's avatar
2 years ago

Testing groovy script on local ubuntu machine

I am searching for a way to run groovy scripts on my local ubuntu (WSL) while being able to work with the same classes that are used by the collectors. To achieve this I installed a java+groovy and d...
  • Anonymous's avatar
    Anonymous
    2 years ago

    They use IntelliJ as the IDE and they do some acrobatics in there to get the collector classes in and recognized by the IDE. They used to use coretools (more later) to run the file on their file system against a target collector.

    Coretools was a set of command line utilities that would allow you to run groovy/posh scripts saved on your file system on a collector against a certain device. So, they’d write a script, save it to their local file system, then run a command like “coretool -run myfile.groovy -device 192.168.0.1” and the output would be echoed to their terminal. For authentication, the early versions used api creds stored in a creds.json file. Later versions utilized a chrome plugin to grab the cookie from your current browser session to LM, allowing the ME team to run it against any portal they could log into using the LM support remote assistance capability (quite secure if you ask me).

    All these tools were made by the ME team and not supported for customer use. At one point it got posted to a github repo, but there was a kerfuffle about it being too powerful for the security folks to be comfortable with. So it was pulled (likely the auth method was not preferable). I’m not sure the ME team still uses it. Not sure what they would do instead. The guy that wrote coretools doesn’t work at LM anymore, i think.

    That’s part of the reason i’m asking for LM to make the VSCode plugin. Coretools already does most of that work and is even written in python. A good developer could build it over the weekend after getting over the VSCode specific learning curve. So it should only take LM a couple months and several dozen developers.